Hi!
I'm a newcomer to nginx from Apache and Lighttpd. I switched two weeks ago on one of our production server and everything seemd to be more than good. But now I have to face a problem I couldn't solve.
I had to setup a subdirectory of the site to be password protected while keep all the behaviours defined by location blocks.
These are:
- pass all PHP to FastCGI UDS
- deny access to special files like *.inc *.log and so on
- turn off autoindex
- set expires on some static files
I have all these setup for the "server" section with location blocks and works well, but when I make a "location" block to protect the given subdirectory, nginx seems to forget all the "outer" config (for e.g.: PHP fastcgi doesn't work).
I found out that one solution can be if I copy the FastCGI location block into the "auth_basic" location block but that code duplication is "not seems to be too nice to me".
Can I somehow password protect a subdir branch while keeping all the other config working. I mean if the given subdir location matches nginx enforces WWW-Auth but after that everything works as before.
It would be a very big help for me.
Thanx: Sandor
(sorry for my english)