安装
yum install epel-release
yum install snapd
systemctl enable --now snapd.socket
ln -s /var/lib/snapd/snap /snap
snap install core; snap refresh core
yum remove certbot
snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot
为nginx添加证书并自动修改nginx配置
certbot --nginx
如果Nginx配置文件不在/etc/nginx/nginx.conf目录,则需要指定目录
certbot --nginx --nginx-server-root=/usr/local/nginx/conf (等号右边填写nginx配置文件的目录)
为nginx添加证书
certbot certonly --nginx
测试证书更新
certbot renew --dry-run
证书更新
certbot renew