Opened 9 years ago

Last modified 8 years ago

#781 new task

Documentation not clear on auth_basic_user_file

Reported by: r.luthiger@… Owned by:
Priority: minor Milestone:
Component: documentation Version: 1.9.x
Keywords: documentation Cc:
uname -a:
nginx -V: doesn't matter

Description

On the page http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html it is not very clear to what auth_basic_user_file is relative to.

Where exactly needs the file htpasswd to be when it is defined like this:

auth_basic_user_file conf/htpasswd;

is it /etc/nginx/conf/htpasswd or something else?

Change History (3)

comment:1 by Ilyas Bakirov, 9 years ago

Path is relative to nginx installation path, where nginx resides on OS. Also you can configure absolute path to files.

Examples:

1- nginx installed on OS in /etc/nginx - conf like auth_basic_user_file conf/htpasswd; then file is located in /etc/nginx/conf/htpasswd

2- nginx installed on OS in /opt/nginx - conf like auth_basic_user_file conf/htpasswd; then file is located in /opt/nginx/conf/htpasswd

3- nginx installed on OS in /usr/local/etc/nginx - conf like auth_basic_user_file /myfolder/conf/htpasswd; then file is located in /myfolder/conf/htpasswd

4- nginx installed on OS in C:\apps\nginx - conf like auth_basic_user_file conf/htpasswd; then file is located in C:\apps\nginx\conf\htpasswd

5- nginx installed on OS in C:\apps\nginx - conf like auth_basic_user_file C:/myfolder/conf/htpasswd; then file is located in C:\myfolder\conf\htpasswd

comment:2 by maxim, 8 years ago

Milestone: 1.9.5

Ticket retargeted after milestone closed

comment:3 by Maxim Dounin, 8 years ago

Component: otherdocumentation
Note: See TracTickets for help on using tickets.