set Https บน nginx ด้วย Let’s Encrypt
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt install python-certbot-nginx
$ sudo nano /etc/nginx/sites-available/default
/etc/nginx/sites-available/default
...
server_name example.com www.example.com;
...
$ sudo systemctl restart nginx
sudo certbot --nginx -d <example.com> -d www.<example.com>
output and select 2
Output
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
https://example.com