[ Nginx - Password Protect Not Working ]
I have followed instructions and still I cant password protect my site. This is what my app-nginx.config looks like:
Where am I going wrong? I copied and pasted this right from a tutorial site.
Make sure Nginx can access the password file. Paths for the auth_basic_user_file are relative to the directory of
nginx.conf. So if your
nginx.conf is located in
/usr/local/nginx you can change your directive to:
and the file must be readable.
This file should be readable by workers, running from unprivileged user. E. g. when nginx run from www you can set permissions as:
chown root:nobody htpasswd_file chmod 640 htpasswd_file