ubuntu自动申请免费ssl证书并配置nginx

Certbot

更新你的包列表并安装 Certbot 和 Nginx 插件。

shell
1
2
sudo apt update
sudo apt install certbot python3-certbot-nginx

申请证书

shell
1
sudo certbot --nginx -d example.com -d www.example.com

手动测试续期过程

shell
1
sudo certbot renew --dry-run