配置https证书

官网: https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx

ssl安装检测工具: https://www.myssl.cn/tools/check-server-cert.html  (检测证书有什么问题)

  • https://snapcraft.io/docs/installing-snap-on-ubuntu    how to install  snap  on  ubuntu  sudo apt update; sudo apt install snapd 

  • Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access(手动选择1 or 2)     1: No redirect 可以同时使用http 和 https    2: redirect 把http301重定向到https.
  • ------------------------------------------------------更新证书-------------------------------------------------------------------
  • 证书有过期时间(90天),好像之前是没有写自动续期的定时任务。所以过期了,本来安照官网执行   sudo certbot renew --dry-run       后来发现此命令只是测试续期的, 不会真正续期, 需要使用其他命令续期。
  • ./certbot-auto renew --quiet --no-self-upgrade (这个提示了没有找到./certbot-auto, 所以没执行成功)
  • 最后使用的方法是   sudo certbot --nginx  (就是安装的命令,不过他判断证书已存在会自动进行更新,而不是安装,也需要选择是否重定向)
  • 查阅: 更新使用的是  certbot-auto renew --force-renewal (强制更新域名的证书,即使离过期时间还很久, 不过这次更新没有尝试使用, 使用的是安装的命令,所以不知道好不好用)
  • 参考: https://blog.csdn.net/kikajack/article/details/79122701
    请看: https://10.linuxstory.net/deploy-lets-encrypt-ssl-certificate-with-certbot/

原文地址:https://www.cnblogs.com/bneglect/p/11421322.html