location / {
    auth_basic           "closed site";##Context:httpserverlocationlimit_except
    auth_basic_user_file conf/htpasswd;##Context:httpserverlocationlimit_except
}
# cat conf/htpasswd
xyJkVhXGAZ8tM
systemctl restart nginx

相关文章: