mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 12:12:26 +08:00
FIX: multisite uploads broken
This commit is contained in:
parent
b560b11f6e
commit
6a685e822a
|
@ -75,6 +75,17 @@ server {
|
|||
}
|
||||
|
||||
location ~ ^/uploads/ {
|
||||
|
||||
# NOTE: it is really annoying that we can't just define headers
|
||||
# at the top level and inherit.
|
||||
#
|
||||
# proxy_set_header DOES NOT inherit, by design, we must repeat it,
|
||||
# otherwise headers are not set correctly
|
||||
#
|
||||
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/;
|
||||
expires 1y;
|
||||
|
@ -88,7 +99,7 @@ server {
|
|||
location ~ /stylesheet-cache/ {
|
||||
try_files $uri =404;
|
||||
}
|
||||
# images
|
||||
# this allows us to bypass rails
|
||||
location ~* \.(gif|png|jpg|jpeg|bmp|tif|tiff)$ {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
@ -101,15 +112,21 @@ server {
|
|||
break;
|
||||
}
|
||||
|
||||
# TODO test in multisite
|
||||
#location ~ ^/(backups|letter_avatar|user_avatar) {
|
||||
location ~ ^/backups/ {
|
||||
# This big block is needed so we can selectively enable
|
||||
# acceleration for backups and avatars
|
||||
# see note about repetition above
|
||||
location ~ ^/(backups|letter_avatar|user_avatar) {
|
||||
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;
|
||||
break;
|
||||
}
|
||||
|
||||
# this means every file in public is tried first
|
||||
try_files $uri @discourse;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user