Password protecting folder breaks PHP within that folder

raab nginx-forum at nginx.us
Thu Dec 3 17:28:27 MSK 2009


Igor Sysoev Wrote:
-------------------------------------------------------
> 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/
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx

That works brilliantly, thanks for that :)

Cheers,
James

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,27597,27603#msg-27603





More information about the nginx mailing list