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
1 changed files with 9 additions and 2 deletions

View File

@ -37,7 +37,7 @@ server {
location / { location / {
root $public; root $public;
location ~* \.(eot|ttf|woff)$ { location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
expires 1y; expires 1y;
@ -87,7 +87,14 @@ server {
location @discourse { location @discourse {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 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_set_header Host $http_host;
proxy_pass http://discourse; proxy_pass http://discourse;