Deactivated buffering to reduce reverse proxy as bottle neck

This commit is contained in:
2022-01-29 19:07:44 +01:00
parent a6e50e5041
commit 9734848663
2 changed files with 11 additions and 0 deletions

View File

@@ -6,11 +6,16 @@ location /
proxy_pass http://127.0.0.1:{{http_port}}/;
{% endif %}
# headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
# deactivate buffering
proxy_buffering off;
proxy_request_buffering off;
# timeouts
proxy_connect_timeout 1s;
proxy_send_timeout 300s;
@@ -19,6 +24,7 @@ location /
# cache media files
location ~* \.(gif|ico|jpg|jpeg|png|svg|mp4|mp3|pdf)$ {
proxy_buffering on;
proxy_cache cache;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_revalidate on;
@@ -37,6 +43,7 @@ location /
# cache content
location ~* \.(html|css|js)$ {
proxy_buffering on;
proxy_cache cache;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_revalidate on;