首先我们先下载nginx安装包dnf install nginx -y这样才可以cd进入nginx生成密钥私钥openssl genrsa -out xxx.key 2048公钥openssl req -new -key xxx.key -x509 -days 365 -out xxx.crt先cd到conf.d/中再进入ssl_web.conf配置vim /etc/nginx/conf.d/ssl_web.confserver{listen 443 ssl http2;server_name *.xxx.com;root /webpage;ssl_certificate /etc/nginx/xxx.crt;ssl_certificate_key /etc/nginx/xxx.key;location /image{root /webpage/image;}location /mp4{root /tmp/mp4;}}当然不要忘记写入内容cd webpage/echo hallo 0.0.0.0 index.html最后重启进行nginx -s reloadOK访问网址即可不安全是正常的这是因为我们是自测使用就这样。