Password protecting folder breaks PHP within that folder

Igor Sysoev igor at sysoev.ru
Thu Dec 3 10:03:17 MSK 2009


On Thu, Dec 03, 2009 at 01:35:28AM -0500, raab wrote:

> I'm trying to password protect a folder using htpasswd, works fine and asks for a l/p, however php in that particular folder refuses to work. PHP works anywhere else but the password protected location. Once I comment out the password protected location and restart nginx it's fine again. Wondering if someone can assist?
> 
> nginx.conf is here: http://raab.ftw.net.nz/nginx.conf

     root    /var/www;

     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include /etc/nginx/fastcgi_params;

     location / {
         index  index.php;
     }

     location = /500.html { }

     location ~* \.(jpg|jpeg|gif)$ {
         expires     30d;
     }

     location ~ ^/rtorrent/.+\.php$ {
         fastcgi_pass 127.0.0.1:9000;
         auth_basic            "Restricted";
         auth_basic_user_file  /usr/local/nginx/htpasswd;
     }

     location ~ ^/rtorrent {
         auth_basic            "Restricted";
         auth_basic_user_file  /usr/local/nginx/htpasswd;
     }

     location ~ \.php$ {
         fastcgi_pass 127.0.0.1:9000;
     }


-- 
Igor Sysoev
http://sysoev.ru/en/




More information about the nginx mailing list