Nginx Let’s Encrypt on Ubunto 18.04

Step 1 Install Certbot

add the rpository
$ sudo add-apt-repository ppa:certbot/certbot
Install Cerbot’s Nginx package
$ sudo apt install python-certbot-nginx

Step 2 Confirming Nginx’s Configuration

$ sudo nano /etc/nginx/sites-available/example.com
...
server_name example.com ;
...
$ sudo nginx -t
$ sudo systemctl reload nginx

Step 3 Allow HTTPS Through the Firewall

$ sudo ufw allow 'Nginx Full'
$ sudo ufw delete allow 'Nginx HTTP'

Step 4  Obtaining an SSL Certificate

$ sudo certbot --nginx -d example.com


กรณี เว็บไซด์ดำเนินการเฉพาะ  https ให้เลือกการดำเนินการในลำดับ 2

Step 5 Verifying Certbot Auto-Renewal

$ sudo certbot renew --dry-runr

Renew scrip to cron.d

อ้างอิง https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04

Share

You may also like...