diff --git a/config/nginx/includes/http-common.conf b/config/nginx/includes/http-common.conf index acdbcda..6ab74a7 100644 --- a/config/nginx/includes/http-common.conf +++ b/config/nginx/includes/http-common.conf @@ -4,9 +4,10 @@ map $http_host $this_host { default $http_host; } -map $http_x_forwarded_proto $the_scheme { - default $http_x_forwarded_proto; - "" $scheme; +map $http_cloudfront_forwarded_proto:$http_x_forwarded_proto $the_scheme { + default $scheme; + "~^https?:.*" $http_cloudfront_forwarded_proto; + "~^:https?$" $http_x_forwarded_proto; } map $http_x_forwarded_host $the_host {