在Debian系统上更新Nginx SSL证书,你可以按照以下步骤操作:
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx
yourdomain.com替换为你的域名:sudo certbot --nginx -d yourdomain.com
Certbot会自动检测Nginx配置文件中的SSL设置,并提示你输入电子邮件地址、同意服务条款等。完成这些步骤后,Certbot会自动更新Nginx配置文件,并生成新的SSL证书。
/etc/letsencrypt/live/yourdomain.com/目录下。使用以下命令备份:sudo cp -r /etc/letsencrypt/live/yourdomain.com /etc/letsencrypt/archive/yourdomain.com
sudo certbot --nginx -d yourdomain.com
sudo nginx -t # 检查配置文件语法是否正确
sudo systemctl reload nginx # 重新加载Nginx配置
现在,你的Nginx服务器应该已经使用了新的SSL证书。请确保在证书到期前及时更新,以避免服务中断。Certbot通常会在证书到期前30天自动提醒你更新。