correct nginx rule forwarding header
This commit is contained in:
parent
d4cc367a6f
commit
1b8a32ba19
|
@ -16,6 +16,13 @@ upstream discourse {
|
||||||
# server unix:/var/www/discourse/tmp/sockets/puam.sock;
|
# 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 {
|
server {
|
||||||
|
|
||||||
listen 80;
|
listen 80;
|
||||||
|
@ -88,11 +95,6 @@ server {
|
||||||
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;
|
||||||
|
|
||||||
# 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 X-Forwarded-Proto $thescheme;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
|
|
|
@ -162,8 +162,7 @@ begin
|
||||||
append = "?api_key=#{api_key}&api_username=admin1"
|
append = "?api_key=#{api_key}&api_username=admin1"
|
||||||
|
|
||||||
# asset precompilation is a dog, wget to force it
|
# asset precompilation is a dog, wget to force it
|
||||||
run "wget http://127.0.0.1:#{@port}/ -o test.html"
|
run "wget http://127.0.0.1:#{@port}/ -o /dev/null"
|
||||||
`rm test.html`
|
|
||||||
|
|
||||||
tests = [
|
tests = [
|
||||||
["home", "/"],
|
["home", "/"],
|
||||||
|
|
Loading…
Reference in New Issue