This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-03-16 21:02:35 +00:00 committed by GitHub
commit 6d891c92cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -196,13 +196,26 @@ http {
'' $scheme;
}
map "$uri" $redirect_location {
default 1;
^/\.well-known 0;
}
# validate $pass_access_scheme and $scheme are http to force a redirect
map "$scheme:$pass_access_scheme" $redirect_to_https {
map "$scheme:$pass_access_scheme" $redirect_scheme {
default 0;
"http:http" 1;
"https:http" 1;
}
# do not redirect if the location is /.well-known
map "$redirect_scheme:$redirect_location" $redirect_to_https {
default 1;
"1:1" 1;
"1:0" 0;
"0:0" 0;
}
map $http_x_forwarded_port $pass_server_port {
default $http_x_forwarded_port;
'' $server_port;