[Auto-Sync] Atualização das configurações em srvproxy001.itguys.com.br - 2025-09-27 22:19:14
This commit is contained in:
parent
178e8f27a8
commit
abd889ac4d
|
|
@ -1,78 +0,0 @@
|
||||||
# ==============================================================================
|
|
||||||
# ARQUIVO: /etc/nginx/sites-available/ns2.itguys.com.br.conf
|
|
||||||
# AUTOR: Gemini (Especialista NGINX)
|
|
||||||
# DATA: 21/09/2025
|
|
||||||
#
|
|
||||||
# DESCRIÇÃO:
|
|
||||||
# Configuração de Proxy Reverso OTIMIZADA para Technitium DNS Server (ns2).
|
|
||||||
# Este modelo usa SSL Termination (certificados no NGINX) para permitir cache e
|
|
||||||
# regras avançadas.
|
|
||||||
# ==============================================================================
|
|
||||||
|
|
||||||
# Define o nosso servidor Technitium como um "upstream".
|
|
||||||
upstream technitium_backend_ns2 {
|
|
||||||
server 172.16.254.251:53443;
|
|
||||||
}
|
|
||||||
|
|
||||||
# ==============================================================================
|
|
||||||
# BLOCO 1: Redirecionamento de HTTP (porta 80) para HTTPS
|
|
||||||
# ==============================================================================
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name ns2.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 Technitium DNS (HTTPS)
|
|
||||||
# ==============================================================================
|
|
||||||
server {
|
|
||||||
listen 443 ssl http2;
|
|
||||||
listen [::]:443 ssl http2;
|
|
||||||
server_name ns2.itguys.com.br;
|
|
||||||
|
|
||||||
# --- CONFIGURAÇÕES DE SSL E SEGURANÇA ---
|
|
||||||
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/ns2.itguys.com.br.access.log;
|
|
||||||
error_log /var/log/nginx/ns2.itguys.com.br.error.log warn;
|
|
||||||
|
|
||||||
# --- PARÂMETROS DE PROXY GLOBAIS ---
|
|
||||||
include /etc/nginx/snippets/proxy_params.conf;
|
|
||||||
proxy_ssl_verify off;
|
|
||||||
|
|
||||||
# --- REGRAS DE ROTEAMENTO (LOCATIONS) ---
|
|
||||||
|
|
||||||
# 1. Rota para assets estáticos (CACHE AGRESSIVO)
|
|
||||||
location ~* \.(?:css|js|mjs|svg|gif|png|jpg|jpeg|ico|wasm|woff2?|ttf|eot)$ {
|
|
||||||
proxy_cache technitium_cache; # Pode reutilizar o mesmo cache do ns1
|
|
||||||
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;
|
|
||||||
proxy_pass https://technitium_backend_ns2;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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://technitium_backend_ns2;
|
|
||||||
}
|
|
||||||
|
|
||||||
# --- Páginas de Erro Personalizadas ---
|
|
||||||
include /etc/nginx/snippets/custom_errors.conf;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue