源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2020-08-20 07:41 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:CentOS 6.7下nginx SSL证书部署的方法
[b]环境[/b] 系统环境:CentOS6.7 nginx version: nginx/1.8.1 [b]证书[/b]
# ls /opt/nginx/conf/ssl
qingkang.me.crt # 公钥
qingkang.me.key # 私钥
[b]配置[/b]
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
[b]总结[/b] 以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对编程素材网的支持。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部