阅读量:1
Nginx SSL续期可通过Certbot工具实现,以下是关键步骤(以Debian系统为例):
-
安装Certbot:
sudo apt update && sudo apt install certbot python3-certbot-nginx -
获取SSL证书:
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com(自动配置Nginx并生成证书文件)
-
启用自动续期:
- Certbot默认创建cron任务,每天检查证书有效期,到期前30天自动续期。
- 手动测试续期:
sudo certbot renew --dry-run
-
验证Nginx配置:
确保配置文件包含正确证书路径(通常位于/etc/nginx/sites-available/):ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;修改后需重新加载Nginx:
sudo nginx -t && sudo systemctl reload nginx -
监控续期状态:
- 查看日志:
sudo tail -f /var/log/letsencrypt/renewal.log。 - 若续期失败,检查DNS解析、Nginx配置是否正确。
- 查看日志:
说明:Certbot会自动处理证书续期及Nginx配置更新,无需手动干预,确保服务持续可用。
以上就是关于“Nginx SSL如何续期”的相关介绍,筋斗云是国内较早的云主机应用的服务商,拥有10余年行业经验,提供丰富的云服务器、租用服务器等相关产品服务。云服务器资源弹性伸缩,主机vCPU、内存性能强悍、超高I/O速度、故障秒级恢复;电子化备案,提交快速,专业团队7×24小时服务支持!
简单好用、高性价比云服务器租用链接:https://www.jindouyun.cn/product/cvm