免费的ssl证书啊,很多网站在用。
参考:
https://github.com/acmesh-official/acme.sh
安装 acme.sh
:
1 | curl https://get.acme.sh | sh -s [email protected] |
生成证书:
1 | acme.sh --issue -d yourdomain.com --webroot /网站在服务器上的绝对路径 |
安装证书:
1 | acme.sh --install-cert -d yourdomain.com \ |
–key-file 私钥文件路径
–fullchain-file 全链证书路径
–ca-file CA证书路径
–reloadcmd 证书更新后执行的命令(如重启Nginx)
nginx配置:
1 | ssl_certificate /new/path/to/fullchain.cer; |
自动续期:
acme.sh的cron任务(自动续期)会自动将新证书安装到上述指定的所有路径,无需手动干预。因此,只要初始安装命令正确,后续续期都会使用相同的路径。