certbot

sudo apt install certbot

让 Certbot 自动编辑您的 nginx 配置以提供证书,只需一步即可打开 HTTPS 访问

sudo certbot –nginx

如果您感觉更保守,并希望手动更改 nginx 配置,请运行此命令

sudo certbot certonly –nginx

Let’s Encrypt 证书的有效期为 90 天,因此您需要设置自动续期以确保证书不会过期。

您可以使用 Certbot 的自动续期功能,或者设置一个定时任务来定期更新证书。您可以通过运行以下命令来测试证书的自动续期

sudo certbot renew –dry-run

这是一个 用 certbot 阿里云插件 申请阿里云免费证书的方式暂时没验证过

https://zhuanlan.zhihu.com/p/25571676513

一张图片