在 Debian 上,如果你是用 Let’s Encrypt + Certbot 申请的 SSL 证书,证书默认就会自动续期,不需要手动配置。下面分情况说明。
sudo apt update
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d example.com -d www.example.com
Certbot 会:
查看 timer 状态:
systemctl status certbot.timer
手动测试续期(不会真的替换证书):
sudo certbot renew --dry-run
✅ 正常情况你什么都不用做
systemctl list-timers | grep certbot
sudo certbot renew
Certbot 在续期成功后会自动执行:
nginx -s reload
一般无需手动配置。
如果你是手动证书(非 Certbot),需要在续期后 reload:
sudo nginx -t && sudo systemctl reload nginx
acme.sh --install-cert -d example.com \
--key-file /etc/nginx/ssl/example.com.key \
--fullchain-file /etc/nginx/ssl/example.com.crt \
--reloadcmd "systemctl reload nginx"
acme.sh 默认有 cron 自动续期。
sudo certbot certificates
看 Expiry Date
Let’s Encrypt 需要 80 端口
证书申请/续期都依赖域名解析
apt install certbot python3-certbot-nginx
certbot --nginx -d 你的域名
✅ 自动续期
✅ 自动 reload nginx
如果你愿意,可以告诉我:
我可以给你更精确的建议。