correct nginx rule forwarding header

This commit is contained in:
Sam 2014-01-09 16:39:30 +11:00
parent d4cc367a6f
commit 1b8a32ba19
2 changed files with 8 additions and 7 deletions

View file

@ -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;

View file

@ -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", "/"],