diff --git a/web/mattermost b/web/mattermost index ff2d363..69a64ec 100644 --- a/web/mattermost +++ b/web/mattermost @@ -1,3 +1,8 @@ +map $http_x_forwarded_proto $proxy_x_forwarded_proto { + default $http_x_forwarded_proto; + '' $scheme; +} + server { listen 80; @@ -10,7 +15,7 @@ server { proxy_set_header Host $http_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; proxy_set_header X-Frame-Options SAMEORIGIN; proxy_pass http://app:APP_PORT; } diff --git a/web/mattermost-ssl b/web/mattermost-ssl index 7138661..ac28a9b 100644 --- a/web/mattermost-ssl +++ b/web/mattermost-ssl @@ -4,6 +4,11 @@ # return 301 https://$server_name$request_uri; # } +map $http_x_forwarded_proto $proxy_x_forwarded_proto { + default $http_x_forwarded_proto; + '' $scheme; +} + server { listen 443; @@ -25,7 +30,7 @@ server { proxy_set_header Host $http_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; proxy_set_header X-Frame-Options SAMEORIGIN; proxy_pass http://app:APP_PORT; }