Created
January 23, 2018 23:51
-
-
Save rcubitto/c24e5d83a95d64751ff5b7275fc4bc32 to your computer and use it in GitHub Desktop.
Add SSL to a site using Let's Encrypt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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