Simple http authentication not working

Maxim Dounin mdounin at
Mon Jun 6 01:43:41 MSD 2011


On Sun, Jun 05, 2011 at 04:22:46PM -0400, pk899 wrote:

> 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. 

It's not clear what is the problem you are complaining about.

1. PHP files in clear text?  You don't have any processing for php 
defined in location /site/private.  Default behaviour is to serve 
anything as static.  So php files being served as static is 
expected result of your config.

2. No HTTP authentication box?  It should appear only once per 
browser start (or may not appear at all if you're brave enough to 
save your password in browser).  Check data of the wire or nginx 
logs (access log should be enough) to see if authentication really 

Maxim Dounin

More information about the nginx mailing list