From 51df8b3be168f17cee8e4e3d07d743db6ec8a218 Mon Sep 17 00:00:00 2001 From: "srvproxy001.itguys.com.br" Date: Tue, 16 Sep 2025 10:22:54 -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-16=2010:22:54?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sites-available/zammad.itguys.com.br.conf | 95 ------------------- 1 file changed, 95 deletions(-) delete mode 100644 nginx/sites-available/zammad.itguys.com.br.conf diff --git a/nginx/sites-available/zammad.itguys.com.br.conf b/nginx/sites-available/zammad.itguys.com.br.conf deleted file mode 100644 index 5218d4a..0000000 --- a/nginx/sites-available/zammad.itguys.com.br.conf +++ /dev/null @@ -1,95 +0,0 @@ -# Ficheiro: /etc/nginx/sites-available/zammad.itguys.com.br.conf -# -# Configuração de Proxy Reverso com cache HÍBRIDO e suporte a WebSockets, -# otimizada especificamente para o Zammad. - -# ============================================================================== -# BLOCO HTTP: Redirecionar para HTTPS -# ============================================================================== -server { - if ($host = zammad.itguys.com.br) { - return 301 https://$host$request_uri; - } # managed by Certbot - - - listen 80; - listen [::]:80; - server_name zammad.itguys.com.br; - location /.well-known/acme-challenge/ { root /var/www/html; } - location / { return 301 https://$host$request_uri; } - - -} - -# ============================================================================== -# BLOCO HTTPS: O Coração da nossa Configuração -# ============================================================================== -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name zammad.itguys.com.br; - - # Certificados SSL (Geridos pelo Certbot) - #ssl_certificate /etc/letsencrypt/live/zammad.itguys.com.br/fullchain.pem; - #ssl_certificate_key /etc/letsencrypt/live/zammad.itguys.com.br/privkey.pem; - - # Cabeçalhos de Segurança Padrão - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; - add_header X-Content-Type-Options "nosniff" always; - - # Configurações de Log - access_log /var/log/nginx/access.log detailed_proxy; - error_log /var/log/nginx/error.log; - - # Aumenta o tamanho máximo do corpo da requisição para permitir anexos grandes. - client_max_body_size 50M; - - # --- CABEÇALHOS DE PROXY GLOBAIS --- - # Estes cabeçalhos serão herdados por TODAS as 'location' abaixo. - 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; - - # --- ESTRATÉGIA DE CACHE HÍBRIDA --- - proxy_cache zammad_cache; # Recomendado criar uma zona de cache dedicada 'zammad_cache' no nginx.conf - add_header X-Proxy-Cache $upstream_cache_status; - proxy_no_cache 1; # Regra geral: NÃO cachear por defeito. - proxy_cache_bypass 1; - - # --- LOCALIZAÇÃO PARA FICHEIROS ESTÁTICOS (CACHE ATIVADO) --- - # O Zammad serve os seus ficheiros estáticos a partir do caminho /assets/ - location /assets/ { - # Ativa o cache para estes ficheiros. - proxy_no_cache 0; - proxy_cache_bypass 0; - proxy_cache_valid 200 60m; - expires 7d; # Instrui o navegador a guardar uma cópia por 7 dias. - - proxy_pass http://172.16.254.59; - } - - # --- LOCALIZAÇÃO PARA WEBSOCKETS (SEM CACHE E HEADERS ESPECIAIS) --- - # Esta regra captura a URL /ws que vimos a falhar no log do F12. - location /ws { - # Cabeçalhos essenciais para "promover" a conexão para WebSocket. - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - - # Desativa o buffering para que os dados fluam em tempo real. - proxy_buffering off; - - proxy_pass http://172.16.254.59; - } - - # --- LOCALIZAÇÃO PRINCIPAL PARA A APLICAÇÃO (SEM CACHE) --- - # Esta regra apanha todo o resto do tráfego (páginas, APIs, ficheiros JSON dinâmicos). - location / { - # O cache permanece desativado aqui por herdar da regra geral. - proxy_pass http://172.16.254.59; - } - - ssl_certificate /etc/letsencrypt/live/zammad.itguys.com.br/fullchain.pem; # managed by Certbot - ssl_certificate_key /etc/letsencrypt/live/zammad.itguys.com.br/privkey.pem; # managed by Certbot -}