生成证书:
https://my.oschina.net/kimver/blog/1634575#comment-list
1.获取certbot-auto
# 下载wget https://dl.eff.org/certbot-auto# 设为可执行权限chmod a+x certbot-auto
2.开始申请证书
# 注xxx.com请根据自己的域名自行更改./certbot-auto --server https://acme-v02.api.letsencrypt.org/directory -d "*.xxx.com" -d "xxx.com" --manual --preferred-challenges dns-01 certonly
执行完这一步之后,会下载一些需要的依赖,如果卡在Installing Python packages...,是因为FW阻挠了PIP的下载,可以修改/新增:
vim ~/.pip/pip.conf
[global]index-url = http://mirrors.aliyun.com/pypi/simple/[install]trusted-host=mirrors.aliyun.com
即可。
复制证书
cp fullchain.pem /etc/nginx/cert/aaa.bbb.com.crt
cp privkey.pem /etc/nginx/cert/aaa.bbb.com.key
重启nginx
service nginx force-reload