mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
BUGFIX: proxy_set_header is weird
in particular no inheritance IF proxy_set_header is specified in child
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user