From 948fefdec9d66694d42b7ef6cb5e91e49f0f1426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Toledo?= Date: Wed, 4 Feb 2026 20:41:37 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20Adiciona=20stack=20de=20compacta=C3=A7?= =?UTF-8?q?=C3=A3o=20moderna=20(Brotli=20+=20Gzip)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 3 ++ snippets/compression.conf | 67 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 snippets/compression.conf diff --git a/nginx.conf b/nginx.conf index 35c1c13..989e51b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -30,6 +30,9 @@ http { client_max_body_size 0; keepalive_timeout 65; + # Compression (Brotli + Gzip) + include /etc/nginx/snippets/compression.conf; + # Logging JSON (Detailed) include /etc/nginx/snippets/log_formats.conf; access_log /var/log/nginx/access.log detailed_proxy; diff --git a/snippets/compression.conf b/snippets/compression.conf new file mode 100644 index 0000000..7ef0a0e --- /dev/null +++ b/snippets/compression.conf @@ -0,0 +1,67 @@ +# --- Pathfinder Modern Compression Stack --- + +# 1. Gzip (Fallback para navegadores antigos e compatibilidade) +gzip on; +gzip_vary on; +gzip_proxied any; +gzip_comp_level 6; +gzip_buffers 16 8k; +gzip_http_version 1.1; +gzip_min_length 256; +gzip_types + application/atom+xml + application/javascript + application/json + application/ld+json + application/manifest+json + application/rss+xml + application/vnd.geo+json + application/vnd.ms-fontobject + application/x-font-ttf + application/x-web-app-manifest+json + application/xhtml+xml + application/xml + font/opentype + image/bmp + image/svg+xml + image/x-icon + text/cache-manifest + text/css + text/plain + text/vcard + text/vnd.rim.location.xloc + text/vtt + text/x-component + text/x-cross-domain-policy; + +# 2. Google Brotli (Próxima geração - Ativado onde suportado) +# Nota: Requer o módulo ngx_brotli compilado. +brotli on; +brotli_comp_level 6; +brotli_static on; +brotli_min_length 256; +brotli_types + application/atom+xml + application/javascript + application/json + application/ld+json + application/manifest+json + application/rss+xml + application/vnd.geo+json + application/vnd.ms-fontobject + application/x-font-ttf + application/x-web-app-manifest+json + application/xhtml+xml + application/xml + font/opentype + image/bmp + image/svg+xml + image/x-icon + text/cache-manifest + text/css + text/plain + text/vcard + text/vnd.rim.location.xloc + text/vtt + text/x-component + text/x-cross-domain-policy;