Created
June 13, 2016 04:44
-
-
Save NamPNQ/2dd76999d2e1fb3b478e8d81932af25c to your computer and use it in GitHub Desktop.
Config nginx + https + letencrypt.sh for gen ssl
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
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