如何设置 nginx 目录密码保护
比如要对 网站目录下的 test 文件夹 进行加密认证
那么 在 nginx.conf 文件中对应的 server 段中 添加
location ^~ /test/ {
auth_basic TEST-Login;
auth_basic_user_file /root/htpasswd;
比如要对 网站目录下的 test 文件夹 进行加密认证
那么 在 nginx.conf 文件中对应的 server 段中 添加
location ^~ /test/ {
auth_basic TEST-Login;
auth_basic_user_file /root/htpasswd;