Skip to content

Commit

Permalink
BUGFIX: attempt to forward on the protocol set by haproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Jan 9, 2014
1 parent cac3257 commit e8afe87
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions config/nginx.sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ server {

location / {
root $public;

location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
expires 1y;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e8afe87

Please sign in to comment.