Simple http authentication not working
pk899
nginx-forum at nginx.us
Mon Jun 6 00:22:46 MSD 2011
Below is my config. The folder /site/private is supposed to show the
usual HTTP authentication box, but the php files from that folder just
start downloading in clear text. What am I doing wrong? The path of the
passwd file is correct.
Thanks for any pointers!
location / {
location
~.*\.(gif|jpg|png|ico|swf|rss|xml|htm|txt|js|css|gz|doc|xls|pdf)$ {
expires max;
try_files $uri @backend;
log_not_found off;
}
location /site/private {
auth_basic "Restricted";
auth_basic_user_file
/home/MYDOMAIN/.htpasswds/public_html/www/private/passwd;
}
proxy_pass http://MY.IP.IS.HERE:8081;
include proxy.inc;
} #-- End of root location
location @backend {
internal;
proxy_pass http://MY.IP.IS.HERE:8081;
include proxy.inc;
}
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,204172,204172#msg-204172
More information about the nginx
mailing list