作者:吴业亮
博客:https://wuyeliang.blog.csdn.net/
加密网页
1、安装httpd-tools工具
# yum -y install httpd-tools
2、修改配置文件/etc/nginx/nginx.conf
# # 在"server" 章节location加入
location / {
auth_basic "Basic Auth";
auth_basic_user_file "/etc/nginx/.htpasswd";
}
3、创建用户
# htpasswd -c /etc/nginx/.htpasswd wyl
4、重启服务
# systemctl restart nginx
4、测试