BUGFIX: attempt to forward on the protocol set by haproxy

This commit is contained in:
Sam 2014-01-09 12:36:42 +11:00
parent cac3257b43
commit e8afe87412

View File

@ -87,7 +87,14 @@ server {
location @discourse {
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;
# attempt to preserve the proto
map $http_x_forwarded_proto $thescheme {
default $scheme;
https https;
}
proxy_set_header X-Forwarded-Proto $thescheme;
proxy_set_header Host $http_host;
proxy_pass http://discourse;