nginx and auth_basic
问题 I am trying to get basic authentication working with nginx in Ubuntu Jaunty. In nginx.conf, I added these two lines under the server context: server { ... auth_basic "Restricted Access"; auth_basic_user_file /etc/nginx/.htpasswd; ... } Then I apt-get'ed apache2-utils to get htpasswd, which I used to create the htpasswd file: htpasswd -d -c /etc/nginx/.htpasswd joe When I try to access the site, the authentication dialog comes up as expected, but when I put in the username and password, it