[root@localhost?~]#?cd?/usr/local/nginx/conf/ [root@localhost?conf]#?openssl?genrsa?>?cert.key?#生成私钥 [root@localhost?conf]#?openssl?req?-new?-x509?-key?cert.key?>?cert.pem?#生成证书 修改配置文件 ????server?{ ????????listen???????443?ssl; ????????server_name??localhost; ????????ssl_certificate??????cert.pem; ????????ssl_certificate_key??cert.key; ????????ssl_session_cache????shared:SSL:1m; ????????ssl_session_timeout??5m; ????????ssl_ciphers??HIGH:!aNULL:!MD5; ????????ssl_prefer_server_ciphers??on; ????????location?/?{ ????????????root???html; ????????????index??index.html?index.htm; ????????} ????} ????[root@localhost?conf]#?/usr/local/nginx/sbin/nginx?-s?reload
原文:https://blog.51cto.com/u_14736864/2824463