首页 > IT职业 > IT生活 > Nginx使用免费的HTTPS证书
使用nginx作为代理工具
certbot
sudo yum install python2-certbot-nginx
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
请先备份你的nginx配置,一般是/etc/nginx/nginx.conf,或/etc/nginx/conf.d/*
这一步需要你已经配置好Nginx,并将域名设置到代理中
sudo certbot --nginx
如果不想Certbot自动更改Nginx配置,使用以下命令
sudo certbot --nginx certonly
certbot的证书 只有90天的有效期,所以需要续订
只有证书过期,才会颁发新的证书,否则不作处理
sudo certbot renew --dry-run
建议采用定时器,每天自动续订两次
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/933/viewspace-2815338/ ,如需转载,请注明出处,否则将追究法律责任。