Skip to content

Instantly share code, notes, and snippets.

@NamPNQ
Created June 13, 2016 04:44
Show Gist options
  • Save NamPNQ/2dd76999d2e1fb3b478e8d81932af25c to your computer and use it in GitHub Desktop.
Save NamPNQ/2dd76999d2e1fb3b478e8d81932af25c to your computer and use it in GitHub Desktop.
Config nginx + https + letencrypt.sh for gen ssl
location /.well-known/acme-challenge {
alias /opt/letsencrypt/.acme-challenges;
}
if ($request_uri !~ "^/\.well-known/acme-challenge.*$"){
set $test notletencrypt;
}
if ($scheme != "https"){
set $test "${test}+notssl";
}
if ($test = "notletencrypt+notssl")
{
rewrite ^ https://$host$uri permanent;
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment