Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion common/etc/nginx/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ map $request_uri $uri_full_path {
"~^(?P<path>.*?)(\?.*)*$" $path;
}

# Retrieves the initial scheme send by the User Agent. This uses
# X-Forwarded-Proto header added by possible proxy or load balancer.
map $http_x_forwarded_proto $real_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}

# Remove/replace a portion of request URL (if configured)
map $uri_full_path $uri_path {
"~^$STRIP_LEADING_DIRECTORY_PATH(.*)" $PREFIX_LEADING_DIRECTORY_PATH$1;
Expand Down Expand Up @@ -304,7 +311,7 @@ server {
# 302 to request without slashes
# Adding a ? to the end of the replacement param in `rewrite` prevents it from
# appending the query string.
rewrite ^ $scheme://$http_host$uri/$is_args$query_string? redirect;
rewrite ^ $real_scheme://$http_host$uri/$is_args$query_string? redirect;
}

# Provide a hint to the client on 405 errors of the acceptable request methods
Expand Down
Loading