I have set up the following on an Ubuntu LTS server installation, using the "default" nginx site configuration file.
From what I have found so far, this should work -- and it does, sort of. If I know the name of a file in that directory, the browser can open it, after entering the userid and password. It can't display the file listing from the directory, I get "403 Forbidden".
Am I using the wrong auth_ module? I have tried with and without the ^~ in front of the directory -- not sure what that's for anyway, found it one one of the nginx doc pages.
[code]
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ^~ /RMS6/ {
auth_basic "closed site";
auth_basic_user_file /etc/nginx/passwd/RMS.pwd;
}
[/code]
I'm not looking for anything complicated here, just a simple password authorization for access to the raw directory.
Is that possible?
From what I have found so far, this should work -- and it does, sort of. If I know the name of a file in that directory, the browser can open it, after entering the userid and password. It can't display the file listing from the directory, I get "403 Forbidden".
Am I using the wrong auth_ module? I have tried with and without the ^~ in front of the directory -- not sure what that's for anyway, found it one one of the nginx doc pages.
[code]
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ^~ /RMS6/ {
auth_basic "closed site";
auth_basic_user_file /etc/nginx/passwd/RMS.pwd;
}
[/code]
I'm not looking for anything complicated here, just a simple password authorization for access to the raw directory.
Is that possible?