From 27958e6c144eee64371be75afe82dd7b4505cd79 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 2 Jan 2026 16:47:43 +0200 Subject: Enable gzip in nginx --- templates/homepage/usr_local_etc_nginx_nginx.conf.j2 | 20 ++++++++++++++++++++ templates/ingress/usr_local_etc_nginx_nginx.conf.j2 | 11 +++++++++++ 2 files changed, 31 insertions(+) diff --git a/templates/homepage/usr_local_etc_nginx_nginx.conf.j2 b/templates/homepage/usr_local_etc_nginx_nginx.conf.j2 index 7d029d2..079f89d 100644 --- a/templates/homepage/usr_local_etc_nginx_nginx.conf.j2 +++ b/templates/homepage/usr_local_etc_nginx_nginx.conf.j2 @@ -11,6 +11,26 @@ http { sendfile on; keepalive_timeout 65; + gzip on; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_min_length 256; + + # Compress sensible, text-based response types (HTML is covered by default) + gzip_types + text/plain + text/css + text/xml + text/javascript + application/javascript + application/json + application/ld+json + application/xml + application/rss+xml + application/atom+xml + image/svg+xml; + server { listen 80 default_server; server_name _; diff --git a/templates/ingress/usr_local_etc_nginx_nginx.conf.j2 b/templates/ingress/usr_local_etc_nginx_nginx.conf.j2 index 086d7f9..1e58153 100644 --- a/templates/ingress/usr_local_etc_nginx_nginx.conf.j2 +++ b/templates/ingress/usr_local_etc_nginx_nginx.conf.j2 @@ -18,6 +18,17 @@ http { access_log /var/log/nginx/access.log vcombined; + gzip on; + gzip_vary on; + gzip_min_length 512; + gzip_types + text/plain + text/css + application/json + application/javascript + application/xml + image/svg+xml; + server { listen 80 default_server; server_name _; -- cgit v1.3