diff --git a/core/nginx/conf/nginx.conf b/core/nginx/conf/nginx.conf index 624e0938..c9bae43d 100644 --- a/core/nginx/conf/nginx.conf +++ b/core/nginx/conf/nginx.conf @@ -20,6 +20,12 @@ http { absolute_redirect off; resolver {{ RESOLVER }} valid=30s; + # Header maps + map $http_x_forwarded_proto $proxy_x_forwarded_proto { + default $http_x_forwarded_proto; + '' $scheme; + } + # Main HTTP server server { # Variables for proxifying diff --git a/core/nginx/conf/proxy.conf b/core/nginx/conf/proxy.conf index c5308a41..f7112c7b 100644 --- a/core/nginx/conf/proxy.conf +++ b/core/nginx/conf/proxy.conf @@ -2,4 +2,4 @@ proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -proxy_set_header X-Forwarded-Proto $scheme; +proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;