Secure Nginx Directory But Not Files -
is there way require authentication view directory listings still allow public access files without authentication?
using sample code:
location / { auth_basic "closed site"; auth_basic_user_file conf/htpasswd; autoindex on; }
requires authentication on both files , directories.
not sure if work or not, try , tell me if works.
location ~ /$ { auth_basic "closed site"; auth_basic_user_file conf/htpasswd; autoindex on; } location / { try_files $uri =404; }
Comments
Post a Comment