Basic authentication

lacibaci nginx-forum at
Fri Jan 13 21:42:01 UTC 2017

I have a location that I would like to protect:

location /private {
    satisfy any;

    deny  all;

    auth_basic           "Protected";
    auth_basic_user_file conf/htpasswd;

This works for /private /private/ and /private/somefile.html

However, when I request (GET or POST) /private/foo.php it will execute
without auth.

How can I set it up so everything under /private is protected?


Posted at Nginx Forum:,271989,271989#msg-271989

More information about the nginx mailing list