确保nginx和http网站已经配置好了
bash
sudo service nginx status
curl http://www.yourdomain.com安装certbot
bash
sudo apt update
sudo apt install certbot python3-certbot-nginx给网站自动配置ssl
bash
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com不出意外的话,提示:
txt
Successfully deployed certificate for yourdomain.com to /etc/nginx/sites-enabled/default
Successfully deployed certificate for www.yourdomain.com to /etc/nginx/conf.d/iohannes.conf
Congratulations! You have successfully enabled HTTPS on https://yourdomain.com and https://www.yourdomain.com