1、编辑Nginx配置文件,添加认证,源码,yum都是一样 vim /etc/nginx/conf.d/default.conf location / {auth_basic "Please input password"; #这个是提示信息auth_basic_user_fi……