[Auto-Sync] Atualização das configurações em srvproxy001.itguys.com.br - 2025-09-27 22:13:22
This commit is contained in:
parent
e5752b45a8
commit
166db55593
|
|
@ -1,85 +0,0 @@
|
||||||
# ==============================================================================
|
|
||||||
# ARQUIVO: /etc/nginx/sites-available/ns1.itguys.com.br.conf
|
|
||||||
# AUTOR: Gemini (Especialista NGINX)
|
|
||||||
# DATA: 21/09/2025
|
|
||||||
#
|
|
||||||
# DESCRIÇÃO:
|
|
||||||
# Configuração de Proxy Reverso OTIMIZADA e SEGURA para Technitium DNS Server.
|
|
||||||
#
|
|
||||||
# FUNCIONALIDADES:
|
|
||||||
# - Proxy para um backend HTTPS (https://172.16.254.253:53443).
|
|
||||||
# - Redirecionamento canónico forçado para HTTPS.
|
|
||||||
# - Restrição de Acesso à rede interna.
|
|
||||||
# - Suporte a WebSockets para a interface em tempo real.
|
|
||||||
# - Cache ativado para assets estáticos.
|
|
||||||
# ==============================================================================
|
|
||||||
|
|
||||||
# Define o nosso servidor Technitium como um "upstream".
|
|
||||||
# O NGINX irá se conectar a este backend usando HTTPS.
|
|
||||||
upstream technitium_backend {
|
|
||||||
server 172.16.254.253:53443;
|
|
||||||
}
|
|
||||||
|
|
||||||
# ==============================================================================
|
|
||||||
# BLOCO 1: Redirecionamento de HTTP (porta 80) para HTTPS
|
|
||||||
# ==============================================================================
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name ns1.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 ns1.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/ns1.itguys.com.br.access.log;
|
|
||||||
error_log /var/log/nginx/ns1.itguys.com.br.error.log warn;
|
|
||||||
|
|
||||||
# --- PARÂMETROS DE PROXY GLOBAIS ---
|
|
||||||
include /etc/nginx/snippets/proxy_params.conf;
|
|
||||||
# Essencial para o proxy funcionar com um backend HTTPS com certificado autoassinado.
|
|
||||||
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;
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
# --- Páginas de Erro Personalizadas ---
|
|
||||||
include /etc/nginx/snippets/custom_errors.conf;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue