这个是之前配置证书的文章,同时更新证书的有效的一篇文章html
最近网站的https证书过时了,形成没法对外提供服务,怀疑是当时配置的自动更新没有起做用。nginx
而后去后台更新https证书,却遇到了问题,使用的具体命令和报错信息:app
sudo certbot renew --dry-run
Attempting to renew cert (cloudappservice.top) from /etc/letsencrypt/renewal/cloudappservice.top.conf produced an unexpected error: Could not automatically find a matching server block.
Set the `server_name` directive to use the Nginx installer.. Skipping
这样看来自动更新是不行的,继续新的方法网站
1.sudo service nginx stop
这里事先中止掉nginx服务,以避免后面由于占用而没法更新.net
2.sudo certbot --force-renewal
执行这一步会强制更新证书,过程当中会有一个选项,这个具体是哪个忘记了,这里还须要往后确认下。在这个命令执行完以后,多出来了2个文件cloudappservice.top-001/fullchain.pem cloudappservice.top-001/privkey.pem.其实这个时候去咱们以前配置的反向代理文件中查看的话,这两个最新的文件已经自动更新替换原来的证书文件了。代理
3.从新启动nginx服务server
sudo cerbot nginx start
到这一步,我再去访问个人网址已经可行了。只是说明之前配置的自动更新证书的配置为何没有生效? htm