BUGFIX: proxy_set_header is weird

in particular no inheritance IF proxy_set_header is specified in child
This commit is contained in:
Sam 2014-03-25 17:06:15 +11:00
parent 2f4ec5a17c
commit 9cf23223eb
1 changed files with 12 additions and 8 deletions

View File

@ -42,14 +42,6 @@ server {
# path to discourse's public directory
set $public /var/www/discourse/public;
# prep all possible needed proxy headers
# this is critical form multisite
proxy_set_header Host $http_host;
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 $thescheme;
location / {
root $public;
@ -83,6 +75,10 @@ server {
location ~ /_optimized/ { try_files $uri =404; }
# attachments must go through the rails application to get the right content-disposition header
proxy_set_header Host $http_host;
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 $thescheme;
proxy_set_header X-Sendfile-Type X-Accel-Redirect;
proxy_set_header X-Accel-Mapping $public/=/downloads/;
proxy_pass http://discourse;
@ -91,6 +87,10 @@ server {
location ~ ^/backups/ {
# backups must go through the rails application to handle security
proxy_set_header Host $http_host;
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 $thescheme;
proxy_set_header X-Sendfile-Type X-Accel-Redirect;
proxy_set_header X-Accel-Mapping $public/=/downloads/;
proxy_pass http://discourse;
@ -106,6 +106,10 @@ server {
}
location @discourse {
proxy_set_header Host $http_host;
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 $thescheme;
proxy_pass http://discourse;
}