Skip to content

Instantly share code, notes, and snippets.

@kmvan
Created April 10, 2019 10:23
Show Gist options
  • Save kmvan/48797770cf0601be90f2996f27cb27c2 to your computer and use it in GitHub Desktop.
Save kmvan/48797770cf0601be90f2996f27cb27c2 to your computer and use it in GitHub Desktop.
nginx ssl site conf
ssl_certificate /etc/letsencrypt/live/DOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/DOMAIN/privkey.pem;
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
if ($host != DOMAIN) {
return 301 $scheme://DOMAIN$request_uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment