[Auto-Sync] Atualização das configurações em srvproxy001.itguys.com.br - 2025-09-21 07:05:12
This commit is contained in:
parent
31eaa9d51a
commit
e2d43cb863
|
|
@ -57,55 +57,46 @@ server {
|
|||
# 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;
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name unifi.itguys.com.br;
|
||||
|
||||
# --- CONFIGURAÇÕES DE SSL E SEGURANÇA ---
|
||||
ssl_certificate /etc/letsencrypt/live/unifi.itguys.com.br/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/unifi.itguys.com.br/privkey.pem; # managed by Certbot
|
||||
include /etc/nginx/snippets/ssl_params.conf;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
# --- CONFIGURAÇÕES DE SSL E SEGURANÇA ---
|
||||
ssl_certificate /etc/letsencrypt/live/unifi.itguys.com.br/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/unifi.itguys.com.br/privkey.pem; # managed by Certbot
|
||||
include /etc/nginx/snippets/ssl_params.conf;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
|
||||
# --- POLÍTICAS DE ACESSO E LOGS ---
|
||||
include /etc/nginx/snippets/internal_networks.conf;
|
||||
include /etc/nginx/snippets/global_robots.conf;
|
||||
access_log /var/log/nginx/unifi.itguys.com.br.access.log;
|
||||
error_log /var/log/nginx/unifi.itguys.com.br.error.log warn;
|
||||
# --- POLÍTICAS DE ACESSO E LOGS ---
|
||||
include /etc/nginx/snippets/internal_networks.conf;
|
||||
include /etc/nginx/snippets/global_robots.conf;
|
||||
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 DE PROXY GLOBAIS ---
|
||||
include /etc/nginx/snippets/proxy_params.conf;
|
||||
# Essencial para o proxy funcionar com o backend HTTPS autoassinado do UniFi.
|
||||
proxy_ssl_verify off;
|
||||
# --- PARÂMETROS DE PROXY GLOBAIS ---
|
||||
include /etc/nginx/snippets/proxy_params.conf;
|
||||
proxy_ssl_verify off;
|
||||
|
||||
# --- REGRAS DE ROTEAMENTO (LOCATIONS) ---
|
||||
# --- REGRAS DE ROTEAMENTO (LOCATIONS) ---
|
||||
|
||||
# 1. Rota para assets estáticos (CACHE AGRESSIVO)
|
||||
location ~* ^/(static|v2|js|css|fonts|images)/ {
|
||||
proxy_cache unifi_cache;
|
||||
proxy_cache_valid 200 7d;
|
||||
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
|
||||
add_header X-Proxy-Cache $upstream_cache_status;
|
||||
# Rota Única para a aplicação (SEM CACHE, COM WEBSOCKETS).
|
||||
# Esta regra centralizada garante que todos os requests, incluindo assets,
|
||||
# sejam enviados corretamente para o backend do UniFi.
|
||||
location / {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
proxy_pass https://unifi_backend_web;
|
||||
}
|
||||
# Cabeçalhos essenciais para o proxy funcionar corretamente com o UniFi
|
||||
proxy_set_header Authorization "";
|
||||
proxy_set_header Host $host;
|
||||
|
||||
# 2. Rota principal para a aplicação (SEM CACHE, COM WEBSOCKETS)
|
||||
location / {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_pass https://unifi_backend_web;
|
||||
}
|
||||
|
||||
# Adicione estas duas linhas para resolver o erro 400
|
||||
proxy_set_header Authorization "";
|
||||
proxy_set_header Host $host;
|
||||
|
||||
proxy_pass https://unifi_backend_web;
|
||||
}
|
||||
|
||||
# --- Páginas de Erro Personalizadas ---
|
||||
include /etc/nginx/snippets/custom_errors.conf;
|
||||
# --- Páginas de Erro Personalizadas ---
|
||||
include /etc/nginx/snippets/custom_errors.conf;
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
|
|
|
|||
Loading…
Reference in New Issue