From d9b9d12d08f47ed8690a56eb8a97ce696cbcd4c5 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 15 Oct 2016 13:26:08 +0200 Subject: [PATCH 1/2] Updated nginx config to provide correct X-Forwared-Proto header --- web/mattermost | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } From a83cc74087f71bcea18c5659ccbc5df94aa9e193 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 15 Oct 2016 13:29:13 +0200 Subject: [PATCH 2/2] Updated nginx ssl config to provide correct X-Forwared-Proto header --- web/mattermost-ssl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; }