背景: 要确保 nginx 的 http 访问已经没问题
1. 安装 Certbot 及 Nginx 插件
dnf install certbot python3-certbot-nginx
2. 申请并自动配置证书
certbot --nginx -d xxx.com -d www.xxx.com
会有几项交互
输入邮箱, 同意条款, 是否共享邮箱, 强制跳转https
3. 确认自动续期
# 查看自动续期任务状态
sudo systemctl status certbot-renew.timer
# 启动自动续期任务
sudo systemctl start certbot-renew.timer
# 测试自动续期(模拟续期,不实际修改证书)
sudo certbot renew --dry-run