From 25686b3cceac9696ad61c4ed69224c69c14184cd Mon Sep 17 00:00:00 2001 From: "srvproxy001.itguys.com.br" Date: Sat, 27 Sep 2025 18:07:05 -0300 Subject: [PATCH] =?UTF-8?q?[Auto-Sync]=20Atualiza=C3=A7=C3=A3o=20das=20con?= =?UTF-8?q?figura=C3=A7=C3=B5es=20em=20srvproxy001.itguys.com.br=20-=20202?= =?UTF-8?q?5-09-27=2018:07:04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sites-available/mimir.itguys.com.br.conf | 169 ------------------ 1 file changed, 169 deletions(-) delete mode 100644 nginx/sites-available/mimir.itguys.com.br.conf diff --git a/nginx/sites-available/mimir.itguys.com.br.conf b/nginx/sites-available/mimir.itguys.com.br.conf deleted file mode 100644 index f4225b8..0000000 --- a/nginx/sites-available/mimir.itguys.com.br.conf +++ /dev/null @@ -1,169 +0,0 @@ -# ================================================================================================= -# ARQUIVO DE CONFIGURAÇÃO PARA: mimir.itguys.com.br (Zabbix) -# AUDITADO E OTIMIZADO POR: Gemini (Especialista NGINX) -# DATA DA ALTERAÇÃO: 24/09/2025 - 21:08 -# VERSÃO: 4.1 (Aplicadas otimizações de compressão, segurança e cache) -# -# DESCRIÇÃO: -# Configuração de Proxy Reverso OTIMIZADA e SEGURA para Zabbix. -# -# MELHORIAS IMPLEMENTADAS: -# -# 1. COMPRESSÃO BROTLI E GZIP: -# - Adicionada compressão de texto via Brotli (prioritário) e Gzip (fallback). -# Isso irá reduzir drasticamente o tamanho dos assets e acelerar o carregamento, -# principalmente em dashboards com muitos dados. -# -# 2. SEGURANÇA SSL/TLS ATUALIZADA: -# - Suíte de cifras (ciphers) modernizada para maior segurança. -# - Adicionado 'ssl_stapling' e 'ssl_trusted_certificate' para otimizar a conexão -# e remover avisos do NGINX. -# -# 3. CONTENT-SECURITY-POLICY (CSP): -# - Adicionado cabeçalho CSP para mitigar ataques XSS. A política permite -# 'unsafe-inline' e 'unsafe-eval', necessários para o funcionamento da UI do Zabbix. -# -# 4. CACHE OTIMIZADO: -# - O cabeçalho 'Cache-Control' para assets estáticos foi aprimorado com a diretiva -# 'immutable' para um cache de navegador mais eficiente. -# -# ================================================================================================= - -# Define o nosso servidor Zabbix como um "upstream" para fácil referência. -upstream zabbix_backend { - server 172.16.254.11; -} - -# Lembrete: A zona de cache deve estar definida no /etc/nginx/nginx.conf, dentro do bloco http {}. -# proxy_cache_path /var/cache/nginx/zabbix_cache keys_zone=zabbix_cache:10m inactive=60m max_size=500m; - -# ============================================================================== -# BLOCO 1: Redirecionamento de HTTP (porta 80) para HTTPS -# ============================================================================== -server { - listen 80; - listen [::]:80; - server_name mimir.itguys.com.br; - - location /.well-known/acme-challenge/ { - root /var/www/html; - allow all; - } - - location / { - return 301 https://$host$request_uri; - } -} - -# ============================================================================== -# BLOCO 2: Servidor Principal - Proxy Reverso para Zabbix (HTTPS) -# ============================================================================== -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name mimir.itguys.com.br; - - root /var/www/html; - - # ================================================================= - # INÍCIO: Configurações de SSL/TLS (ATUALIZADO) - # ================================================================= - ssl_certificate /etc/letsencrypt/live/mimir.itguys.com.br/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/mimir.itguys.com.br/privkey.pem; - ssl_trusted_certificate /etc/letsencrypt/live/mimir.itguys.com.br/fullchain.pem; - ssl_protocols TLSv1.2 TLSv1.3; - ssl_prefer_server_ciphers off; - ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384'; - ssl_session_timeout 1d; - ssl_session_tickets off; - ssl_stapling on; - ssl_stapling_verify on; - # ================================================================= - # FIM: Configurações de SSL/TLS - # ================================================================= - - # ================================================================= - # INÍCIO: Cabeçalhos de Segurança (ATUALIZADO) - # ================================================================= - add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; - add_header X-Content-Type-Options "nosniff" always; - add_header X-Frame-Options "SAMEORIGIN" always; - add_header X-XSS-Protection "1; mode=block" always; - add_header Referrer-Policy "no-referrer-when-downgrade" always; - # CSP para Zabbix, permitindo scripts e estilos inline. - add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; object-src 'none'; frame-ancestors 'self';" always; - # ================================================================= - # FIM: Cabeçalhos de Segurança - # ================================================================= - - # ================================================================= - # INÍCIO: Configurações de Compressão Brotli & Gzip (NOVO) - # ================================================================= - brotli on; - brotli_comp_level 6; - brotli_types application/atom+xml application/javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype application/x-font-ttf application/x-javascript application/xhtml+xml application/xml font/eot font/opentype font/otf font/truetype image/svg+xml image/x-icon text/css text/javascript text/plain text/xml; - gzip on; - gzip_vary on; - gzip_min_length 1024; - gzip_proxied expired no-cache no-store private auth; - gzip_types application/atom+xml application/javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype application/x-font-ttf application/x-javascript application/xhtml+xml application/xml font/eot font/opentype font/otf font/truetype image/svg+xml image/x-icon text/css text/javascript text/plain text/xml; - gzip_disable "MSIE [1-6]\."; - # ================================================================= - # FIM: Configurações de Compressão - # ================================================================= - - # A TRAVA DE SEGURANÇA: Restringe o acesso à rede interna. - include /etc/nginx/snippets/internal_networks.conf; - - # Bloqueia a indexação por motores de busca. - location = /robots.txt { - add_header Content-Type text/plain; - return 200 "User-agent: *\nDisallow: /\n"; - access_log off; - log_not_found off; - } - - access_log /var/log/nginx/mimir.itguys.com.br.access.log; - error_log /var/log/nginx/mimir.itguys.com.br.error.log warn; - - # --- PARÂMETROS DE PROXY GLOBAIS --- - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_connect_timeout 90s; - proxy_send_timeout 90s; - proxy_read_timeout 90s; - proxy_buffers 8 16k; - proxy_buffer_size 32k; - - # --- REGRAS DE ROTEAMENTO (LOCATIONS) --- - - # 1. Rota para assets estáticos (CACHE AGRESSIVO - ATUALIZADO) - location ~* \.(?:css|js|mjs|svg|gif|png|jpg|jpeg|ico|wasm|woff2?|ttf|eot)$ { - expires 30d; - add_header Cache-Control "public, immutable"; # Aprimorado - - proxy_cache zabbix_cache; - proxy_cache_valid 200 302 7d; - proxy_cache_valid any 1m; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; - add_header X-Proxy-Cache $upstream_cache_status; - - proxy_pass http://zabbix_backend; - } - - # 2. Rota principal para a aplicação (SEM CACHE) - location / { - proxy_pass http://zabbix_backend; - } - - # --- Páginas de Erro Personalizadas --- - error_page 500 502 503 504 /50x.html; - location = /50x.html { - internal; - } -}