CentOS7-Nginx配置Let‘s-Encrypt-SSL证书

本文介绍了如何在CentOS7上为Nginx配置Let's-Encrypt SSL证书,包括安装过程、证书自动更新方法以及Nginx SSL证书的配置步骤。通过自动更新脚本确保证书始终保持有效,同时提供了Nginx配置文件的示例。
摘要由CSDN通过智能技术生成

Let's-Encrypt

为http站点添加https支持,需要从证书发行机构获取SSL/TLS 证书。常见的免费证书有两种:

安装

yum install epel-release -y
yum install certbot -y

配置

certbot certonly --webroot -w /www/html -d suncle.me -d www.suncle.me
  • --webroot表示以webroot模式运行,此处我们不选择standalone模式
  • -w /www/html表示站点根目录在/www/html
  • -d suncle.me -d www.suncle.me表示为@主机和www主机生成共同的证书

按照提示操作成功后,提示:

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at
   /etc/letsencrypt/live/suncle.me/fullchain.pem. Your cert will
   expire on 2017-06-28. To obtain a new or tweaked version of this
   certificate in the future, simply run certbot again. To
   non-interactively renew *all* of your certificates, run "certbot
   renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值