服务器 
首页 > 服务器 > 浏览文章

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

(编辑:jimmy 日期: 2024/10/19 浏览:3 次 )

环境

系统环境: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

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对的支持。

上一篇:详解Centos7中Nginx开机自启动的解决办法
下一篇:在CentOS 7上给一个网卡分配多个IP地址的方法
一句话新闻
微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 SiteMap