mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
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;
|
||||
# }
|
||||
|
||||
|
||||
# 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;
|
||||
|
|
|
@ -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", "/"],
|
||||
|
|
Loading…
Reference in New Issue
Block a user