Skip to content

Instantly share code, notes, and snippets.

@Nikschavan
Created January 29, 2018 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nikschavan/be9cbc0e738268ad063a6fe3b72547c7 to your computer and use it in GitHub Desktop.
Save Nikschavan/be9cbc0e738268ad063a6fe3b72547c7 to your computer and use it in GitHub Desktop.
Nginx SSL Configuration for Let's Encrypt.
listen 443 http2 ssl;
ssl on;
ssl_certificate /etc/letsencrypt/live/<your-domain>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<your-domain>/privkey.pem;
@Nikschavan
Copy link
Author

  1. Download the file to the directory to the config directory of the new domain
curl -L https://gist.githubusercontent.com/Nikschavan/be9cbc0e738268ad063a6fe3b72547c7/raw/faa3bdd37aa8a9459e2b5710fc6bd0d367f80cf5/ssl.conf.template -o <your-domain-name-here>/conf/nginx/ssl.conf
  1. Replace the dummy domain name from the template to your correct domain name.
    Note - Replace <replace-your-domain-name-here> with the actual domain name.
sed -i.default "s/<your-domain>/<replace-your-domain-name-here>/" <replace-your-domain-name-here>/conf/nginx/ssl.conf
  1. Reload Nginx Configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment