fix(proxy): turn off nginx_proxy_buffer (#2246)

* Refactor poxy_* directives

Move from location to server context, as they are identical

* Disable proxy_request_buffering

proxy_buffering is already off, no reason to have proxy_request_buffering on. In fact, leaving it on can cause nginx to (temporarily) use a lot of disk space during uploads
This commit is contained in:
TruongSinh Tran-Nguyen 2023-04-13 15:38:49 -05:00 committed by GitHub
parent a9859bc029
commit 4952b3a2d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,20 +43,22 @@ server {
image/svg+xml
text/css;
location /api {
proxy_buffering off;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
proxy_force_ranges on;
proxy_buffering off;
proxy_request_buffering off;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
proxy_force_ranges on;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $forwarded_protocol;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $forwarded_protocol;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
location /api {
rewrite /api/(.*) /$1 break;
@ -64,19 +66,6 @@ server {
}
location / {
proxy_buffering off;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
proxy_force_ranges on;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $forwarded_protocol;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass ${IMMICH_WEB_SCHEME}web;
}