File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
common/etc/nginx/templates Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,13 @@ map $request_uri $uri_full_path {
1313 "~^(?P<path>.*?)(\?.*)*$" $path;
1414}
1515
16+ # Retrieves the initial scheme send by the User Agent. This uses
17+ # X-Forwarded-Proto header added by possible proxy or load balancer.
18+ map $http_x_forwarded_proto $real_scheme {
19+ default $http_x_forwarded_proto;
20+ "" $scheme;
21+ }
22+
1623# Remove/replace a portion of request URL (if configured)
1724map $uri_full_path $uri_path {
1825 "~^$STRIP_LEADING_DIRECTORY_PATH(.*)" $PREFIX_LEADING_DIRECTORY_PATH$1;
@@ -306,7 +313,7 @@ server {
306313 # 302 to request without slashes
307314 # Adding a ? to the end of the replacement param in `rewrite` prevents it from
308315 # appending the query string.
309- rewrite ^ $scheme ://$http_host$uri/$is_args$query_string? redirect;
316+ rewrite ^ $real_scheme ://$http_host$uri/$is_args$query_string? redirect;
310317 }
311318
312319 # Provide a hint to the client on 405 errors of the acceptable request methods
You can’t perform that action at this time.
0 commit comments