As the titles suggests, I am trying to password protect all directories and sub-directories, but not the files. This is so that I can still browse through the files, and share the download links privately.
I have tried many configurations, but I can't seem to get it to work, here is the latest of many:
location ~ ^/(files|files/).*$ {
auth_basic "Restricted";
auth_basic_user_file /path/to/.htpasswd;
autoindex on;
}
location ~ ^/files/* {
autoindex off;
}
It is based off this post.
Thank you in advance for any responses!