diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2026-01-02 16:47:43 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2026-01-02 16:47:43 +0200 |
| commit | 27958e6c144eee64371be75afe82dd7b4505cd79 (patch) | |
| tree | 55d33116c56824d5dfdb3c7aa6f6232b31378495 | |
| parent | 1b3a892b3a0af90ee7239b67eecb0d2f510aa0b9 (diff) | |
Enable gzip in nginx
| -rw-r--r-- | templates/homepage/usr_local_etc_nginx_nginx.conf.j2 | 20 | ||||
| -rw-r--r-- | templates/ingress/usr_local_etc_nginx_nginx.conf.j2 | 11 |
2 files changed, 31 insertions, 0 deletions
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 _; |
