在 nginx 配置中,对需要保护的站点配置文件中你需要做如下配置: ubuntu apt install apache2-utils htpasswd -c /etc/nginx/.htpasswd nico #nico为输入的用户名 centos yum install httpd-tools htpasswd -c /etc/nginx/.htpasswd nico #nico为输入的用户名 nginx应用配置 server{}中添加下面的配置 auth_basic "Administrator Area";…