实验步骤
1.防火墙配置(不关闭防火墙)
永久开放http和https端口

验证防火墙规则

2.安装nginx和基础配置
dnf install nginx -y
设置开机自启动
systemctl start nginx
systemctl enable --now nginx
3.ssl证书配置
创建证书存储目录

生成自签名证书(生产环境应使用CA签发证书)


4.HTTP基本认证配置
安装htpasswd工具
dnf install httpd-tools -y
创建认证用户文件和密码

Nginx HTTPS服务器配置
创建主配置文件

检查Nginx配置语法

重新加载Nginx配置

5.测试
