Password protection and fastcgi

Veerle nginx-forum at nginx.us
Tue Dec 20 21:43:11 UTC 2011


Hello,

i have a problem with a password protected folder and fastcgi php:
server {
  root /foo/;
  ...
  location ~ \.php$ {
    fastcgi_pass foo;
    include fastcgi_parms;
  }
  location ^~ /passwordprotected {
    auth_basic "foo";
    auth_basic_user_file foo;
  }
}

The protection works fine, but php don't work. Then i added the
fastcgi_pass part to my new location, but then images will be parsed
too.

What's the right way to protect folders?

Thanks

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



More information about the nginx mailing list