Skip to content

Instantly share code, notes, and snippets.

@Peregrinox
Last active February 6, 2018 14:41
Show Gist options
  • Save Peregrinox/2934a94314c6678dad363965d5341384 to your computer and use it in GitHub Desktop.
Save Peregrinox/2934a94314c6678dad363965d5341384 to your computer and use it in GitHub Desktop.
adding new certificate

Create separate server blocks for each "same certificate" group of domains, as in: https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

$ sudo update-alternatives --config python 

and select "2.7"

check with

$ python -V

Creation of certificates:

$ sudo certbot certonly -a webroot --webroot-path=/var/www/html -d newsubdomain.duckdns.org

Check files were created in

$ sudo ls -l /etc/letsencrypt/live/newsubdomain.duckdns.org

Create a nginx Configuration Snippet Pointing to the SSL Key and Certificate

$ sudo nano /etc/nginx/snippets/ssl-newsubdomain.duckdns.org.conf

with contents:

ssl_certificate /etc/letsencrypt/live/newsubdomain.duckdns.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/newsubdomain.duckdns.org/privkey.pem;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment