CentOS 6.7下nginx SSL证书部署的方法分享

这篇文章主要介绍了在CentOS 6.7下nginx SSL证书部署的方法,文中介绍的非常详细,需要的朋友可以参考借鉴,下面来一起看看吧。
环境

系统环境:CentOS6.7

nginx version: nginx/1.8.1

证书

ls /opt/nginx/conf/sslqingkang.me.crt # 公钥qingkang.me.key # 私钥

配置

vim nginx.conf
找到以下内容

HTTPS server##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;# }#}

修改为:

server { listen 443 ssl; server_name qingkang.me; ssl_certificate ssl/qingkang.me.crt; ssl_certificate_key http://www.iis7.com/b/ssyqdq/  ssl/qingkang.me.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; } }
检查配置

/opt/nginx/sbin/nginx -t
重启Nginx生效

/opt/nginx/sbin/nginx -s reload

posted @ 2019-03-30 11:20  03ngnntds  阅读(217)  评论(0)    收藏  举报