背景和目标:
域名:nightwish.tech(阿里云申请)
虚拟机:Azure Ubutun(公司给的MSDN 订阅)
Web server: Nginx
Hexo 的个人静态博客host在Azure Ubutun虚拟机的Nginx上,可以通过 http:nightwish.tech去访问,但是无法https 访问,希望通过申请SSL 证书可以通过https访问博客
步骤:
-
https://letsencrypt.org/zh-cn/ 可以申请免费的SSL证书,有效期3个月
-
根据官网的安装文档 推荐使用cerbot安装证书 https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx
2.1 通过SSH 登录虚拟机,执行如下命令
sudo snap install --classic certbot sudo certbot --nginx

2.2 证书到期自动刷新,执行如下命令
sudo certbot renew --dry-run
