I want to access the folder /folder/subfolder/
in the webservers root (/var/www/dl.somewebsite.com/files/
) with a password the rest should be public accessible. Using the script below I get a 403 Forbidden error when using the right credentials. What am I missing out here?
server {
listen 80;
server_name dl.somewebsite.com;
access_log /var/www/nginx-logs/dl.somewebsite.com combined;
root /var/www/dl.somewebsite.com/files/;
location / {
autoindex on;
}
location ^~ /folder/subfolder/ {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/somefolder/dl.somewebsite.com/.htpasswd;
}
}
403 Forbidden
?htpasswd -c someusername
from apache2 utilities