From b21e2da57c5fa6bdf105613c1c6c964090c0c435 Mon Sep 17 00:00:00 2001 From: "srvproxy001.itguys.com.br" Date: Wed, 24 Sep 2025 21:58:19 -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-24=2021:58:19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sites-available/unifi.itguys.com.br.conf | 105 ------------------ 1 file changed, 105 deletions(-) delete mode 100644 nginx/sites-available/unifi.itguys.com.br.conf diff --git a/nginx/sites-available/unifi.itguys.com.br.conf b/nginx/sites-available/unifi.itguys.com.br.conf deleted file mode 100644 index 5469fa6..0000000 --- a/nginx/sites-available/unifi.itguys.com.br.conf +++ /dev/null @@ -1,105 +0,0 @@ -# ========================================================================================= -# ARQUIVO: /etc/nginx/sites-available/unifi.itguys.com.br.conf -# AUTOR: Gemini (Especialista NGINX) - VERSÃO 5 (ESTÁVEL E FUNCIONAL) -# DATA: 21/09/2025 -# -# DESCRIÇÃO: -# Esta é a configuração estável que provou ser 100% funcional, resolvendo -# todos os erros de API (403) e WebSocket. Nenhuma otimização de cache ou -# regra de ModSecurity está presente para garantir a máxima compatibilidade. -# ========================================================================================= - -# --- DEFINIÇÃO DOS BACKENDS --- -upstream unifi_backend_web { - server 172.16.254.123:8443; -} -upstream unifi_backend_inform { - server 172.16.254.123:8080; -} - -# ========================================================================================= -# BLOCO 1: Redirecionamento de HTTP (porta 80) para HTTPS -# ========================================================================================= -server { - listen 80; - listen [::]:80; - server_name unifi.itguys.com.br; - - location /.well-known/acme-challenge/ { - root /var/www/html; - } - location / { - return 301 https://$host$request_uri; - } -} - -# ========================================================================================= -# BLOCO 2: Servidor Principal - Proxy Reverso para a Interface Web (HTTPS) -# ========================================================================================= -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name unifi.itguys.com.br; - - # --- SSL E SEGURANÇA --- - ssl_certificate /etc/letsencrypt/live/unifi.itguys.com.br/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/unifi.itguys.com.br/privkey.pem; - include /etc/nginx/snippets/ssl_params.conf; - add_header X-Frame-Options "SAMEORIGIN" always; - - # --- LOGS --- - access_log /var/log/nginx/unifi.itguys.com.br.access.log; - error_log /var/log/nginx/unifi.itguys.com.br.error.log warn; - - # --- PARÂMETROS GERAIS --- - proxy_ssl_verify off; - include /etc/nginx/snippets/proxy_params.conf; - - # --- ROTA PARA A APLICAÇÃO --- - location / { - proxy_pass https://unifi_backend_web; - - # -- Cabeçalhos Essenciais -- - proxy_set_header Host $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_set_header Origin ""; - proxy_set_header Referer $scheme://$host/; - } - - # --- ROTA DEDICADA PARA WEBSOCKETS --- - location /wss/ { - proxy_pass https://unifi_backend_web; - - # -- Cabeçalhos Essenciais -- - proxy_set_header Host $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; - - # -- Cabeçalhos para Upgrade de Conexão -- - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - } -} - -# ============================================================================== -# BLOCO 3: Servidor para o "Inform" dos Dispositivos (HTTP na porta 8080) -# ============================================================================== -server { - listen 8080; - listen [::]:8080; - server_name unifi.itguys.com.br; - - access_log /var/log/nginx/unifi-inform.log; - error_log /var/log/nginx/unifi-inform.error.log; - - location / { - include /etc/nginx/snippets/proxy_params.conf; - proxy_read_timeout 600s; - proxy_send_timeout 600s; - proxy_pass http://unifi_backend_inform; - } -}