17 lines
No EOL
446 B
Text
17 lines
No EOL
446 B
Text
set $test "";
|
|
if ($scheme = "http") {
|
|
set $test "H";
|
|
}
|
|
if ($request_uri ~ "^\/\.well-known\/acme-challenge\/(.*)" {
|
|
set $test "${test}T";
|
|
}
|
|
if ($test = H) {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
if ($request_uri !~ "^\/\.well-known\/acme-challenge\/(.*)") {
|
|
set $FORCE "${FORCE}D";
|
|
}
|
|
# If we are http and outside the LetsEncrypt directories redirect to https via 301
|
|
if ($FORCE = HD) {
|
|
return 301 https://$host$request_uri;
|
|
} |