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;