diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf index 0e52d175517..d6360c805aa 100644 --- a/config/nginx.sample.conf +++ b/config/nginx.sample.conf @@ -16,6 +16,13 @@ upstream discourse { # server unix:/var/www/discourse/tmp/sockets/puam.sock; # } + +# attempt to preserve the proto, must be in http context +map $http_x_forwarded_proto $thescheme { + default $scheme; + https https; +} + server { listen 80; @@ -88,11 +95,6 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # 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; diff --git a/script/bench.rb b/script/bench.rb index 661eb3e7976..a3904e590ae 100644 --- a/script/bench.rb +++ b/script/bench.rb @@ -162,8 +162,7 @@ begin append = "?api_key=#{api_key}&api_username=admin1" # asset precompilation is a dog, wget to force it - run "wget http://127.0.0.1:#{@port}/ -o test.html" - `rm test.html` + run "wget http://127.0.0.1:#{@port}/ -o /dev/null" tests = [ ["home", "/"],