Skip to content

Instantly share code, notes, and snippets.

@rcubitto
Created January 23, 2018 23:51
Show Gist options
  • Save rcubitto/c24e5d83a95d64751ff5b7275fc4bc32 to your computer and use it in GitHub Desktop.
Save rcubitto/c24e5d83a95d64751ff5b7275fc4bc32 to your computer and use it in GitHub Desktop.
Add SSL to a site using Let's Encrypt
# taken from https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04 with a tweak
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
# you should have your site's config file already created. /etc/nginx/sites-avalable/{domain.com}
# allow HTTPS through Firewall
sudo ufw allow 'Nginx Full'
sudo ufw delete allow 'Nginx HTTP'
# get the certificate
sudo certbot --authenticator standalone --installer nginx -d {domain.com} -d {www.domain.com} --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment