move text compression from Caddy to nginx for lower latency

Nginx is closer to the origin, so compressing there avoids an
extra hop. Removes the Caddy encode block for Nextcloud and adds
gzip in nginx with level 4 targeting text, CSS, JS, JSON, XML, SVG.
This commit is contained in:
2026-03-22 21:08:40 +01:00
parent d62b627093
commit a02f33e96e
2 changed files with 7 additions and 12 deletions

View File

@@ -9,18 +9,6 @@
} }
nextcloud.t-gstone.de { nextcloud.t-gstone.de {
encode zstd gzip {
match {
header Content-Type text/*
header Content-Type application/javascript*
header Content-Type application/json*
header Content-Type application/xml*
header Content-Type application/rss*
header Content-Type application/atom*
header Content-Type image/svg*
}
}
reverse_proxy nextcloud-nginx:80 reverse_proxy nextcloud-nginx:80
header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"

View File

@@ -20,6 +20,13 @@ server {
application/javascript mjs; application/javascript mjs;
} }
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied any;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml;
client_max_body_size 10G; client_max_body_size 10G;
client_body_timeout 300s; client_body_timeout 300s;
fastcgi_buffers 64 4K; fastcgi_buffers 64 4K;