feat: Adiciona stack de compactação moderna (Brotli + Gzip)

This commit is contained in:
João Pedro Toledo Goncalves 2026-02-04 20:41:37 -03:00
parent a537e52503
commit 948fefdec9
2 changed files with 70 additions and 0 deletions

View File

@ -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;

67
snippets/compression.conf Normal file
View File

@ -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;