企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
location / { auth_basic "closed site"; auth_basic_user_file conf/htpasswd; } 案例: mkdir /usr/local/nginx/users location / { root "/vhosts/web1"; allow 10.2.18.231; deny all; auth_basic "only for vip"; auth_basic_user_file /usr/local/nginx/users/.htpasswd; } [root@static nginx]# htpasswd -c -m /usr/local/nginx/users/.htpasswd tom New password: Re-type new password: Adding password for user tom [root@static nginx]# /usr/local/nginx/sbin/nginx -s reload