mirror of
https://github.com/discourse/discourse.git
synced 2025-04-02 04:10:10 +08:00
BUGFIX: proxy_set_header is weird
in particular no inheritance IF proxy_set_header is specified in child
This commit is contained in:
parent
2f4ec5a17c
commit
9cf23223eb
@ -42,14 +42,6 @@ server {
|
|||||||
# path to discourse's public directory
|
# path to discourse's public directory
|
||||||
set $public /var/www/discourse/public;
|
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 / {
|
location / {
|
||||||
root $public;
|
root $public;
|
||||||
|
|
||||||
@ -83,6 +75,10 @@ server {
|
|||||||
location ~ /_optimized/ { try_files $uri =404; }
|
location ~ /_optimized/ { try_files $uri =404; }
|
||||||
|
|
||||||
# attachments must go through the rails application to get the right content-disposition header
|
# 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-Sendfile-Type X-Accel-Redirect;
|
||||||
proxy_set_header X-Accel-Mapping $public/=/downloads/;
|
proxy_set_header X-Accel-Mapping $public/=/downloads/;
|
||||||
proxy_pass http://discourse;
|
proxy_pass http://discourse;
|
||||||
@ -91,6 +87,10 @@ server {
|
|||||||
|
|
||||||
location ~ ^/backups/ {
|
location ~ ^/backups/ {
|
||||||
# backups must go through the rails application to handle security
|
# 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-Sendfile-Type X-Accel-Redirect;
|
||||||
proxy_set_header X-Accel-Mapping $public/=/downloads/;
|
proxy_set_header X-Accel-Mapping $public/=/downloads/;
|
||||||
proxy_pass http://discourse;
|
proxy_pass http://discourse;
|
||||||
@ -106,6 +106,10 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location @discourse {
|
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;
|
proxy_pass http://discourse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user