“`
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install -y python-certbot-nginx
“`
Then get a certificate `sudo certbot –nginx certonly`
Now edit the nginx config to add the fullchain.pem and privkey.pem paths.
sudo vim /etc/nginx/sites-enabled/default
Add lines 22-25.
server {
20 # SSL configuration
21 #
22 listen 443 ssl default_server;
23 listen [::]:443 ssl default_server;
24 ssl_certificate_key /etc/letsencrypt/live/autox.network/privkey.pem;
25 ssl_certificate /etc/letsencrypt/live/autox.network/fullchain.pem;
…
}