]# cd /etc/nginx/ 拷贝文件: #rz ---上传ssl 配置文件,key and crt 添加文件: cd /usr/share/nginx/html rz cd /etc/nginx/conf.d touch xxxkeji.conf vim xxxkeji.conf 加入: -- server { listen 443 ssl; server_name www.xxxkeji.com; root /usr/share/nginx/html; ssl_certificate xxkeji.crt; ssl_certificate_key xxkeji.key; include /etc/nginx/default.d/*.conf; location / { root /usr/share/nginx/html; index xxxkeji.html; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } -- --保存退出:esc键 :wq -- root@VM-0-16-ubuntu:/etc/nginx/conf.d# cd root@VM-0-16-ubuntu:~# service nginx restart root@VM-0-16-ubuntu:~# 2.进入该目录下 cd /usr/sbin 3. 重启 ./nginx -s reload --开启云上服务器进出安全规则443端口及域名解析www、关联云服务器IP。
标签:ssl,证书,--,cd,nginx,html,conf From: https://www.cnblogs.com/liuguiqing/p/17702531.html