CentOS 6.7下nginx SSL证书部署的方法
环境
系统环境:CentOS6.7
nginx version: nginx/1.8.1
证书
# ls /opt/nginx/conf/ssl qingkang.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 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
相关推荐
HanksWang 2020-11-10
夜雨倚琴 2020-09-06
Junzizhiai 2020-10-10
LzHeng 2020-07-04
windzoone 2020-08-06
这些年来 2020-07-19
CSDNMrWang 2020-07-06
Neptune 2020-07-05
CSDNMrWang 2020-06-22
zkwgpp 2020-06-15
某些公司会墙特定网站,如果你有一个可访问的域名和服务器,就可以通过nginx反向代理来来解决这些问题。比如现在我们用mirror.example.com镜像www.baidu.com,以下是详细操作。
byourb 2020-06-05
LzHeng 2020-06-05
duckes 2020-05-17
gongruitao 2020-05-16
LczPtr 2020-05-09
onlykg 2020-05-12
yongzhang 2020-05-10