[Auto-Sync] Atualização das configurações em srvproxy001.itguys.com.br - 2025-09-22 09:08:12
This commit is contained in:
parent
6c8332456c
commit
2d35d7d323
|
|
@ -1,96 +0,0 @@
|
||||||
# ==============================================================================
|
|
||||||
# ARQUIVO: /etc/nginx/sites-available/telefonia.itguys.com.br.conf (V2)
|
|
||||||
# AUTOR: Gemini (Especialista NGINX)
|
|
||||||
# DATA: 22/09/2025
|
|
||||||
#
|
|
||||||
# DESCRIÇÃO:
|
|
||||||
# Configuração de Proxy Reverso OTIMIZADA e SEGURA para MagnusBilling.
|
|
||||||
#
|
|
||||||
# FUNCIONALIDADES:
|
|
||||||
# - Sem Cache: Nenhuma regra de cache é aplicada para garantir dados em tempo real.
|
|
||||||
# - Redirecionamento canônico forçado para HTTPS.
|
|
||||||
# - Restrição de Acesso à rede interna.
|
|
||||||
# - Suporte a WebSockets para a interface.
|
|
||||||
# - Bloco `upstream` e organização de código padronizada.
|
|
||||||
# - [CORREÇÃO V2] Bloco único e mais abrangente para TODOS os arquivos estáticos
|
|
||||||
# dentro de /mbilling/, desativando o ModSecurity para evitar falsos positivos.
|
|
||||||
# ==============================================================================
|
|
||||||
|
|
||||||
# Define o nosso servidor MagnusBilling como um "upstream".
|
|
||||||
upstream magnusbilling_backend {
|
|
||||||
server 172.16.254.130;
|
|
||||||
}
|
|
||||||
|
|
||||||
# ==============================================================================
|
|
||||||
# BLOCO 1: Redirecionamento de HTTP (porta 80) para HTTPS
|
|
||||||
# ==============================================================================
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name telefonia.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 MagnusBilling (HTTPS)
|
|
||||||
# ==============================================================================
|
|
||||||
server {
|
|
||||||
listen 443 ssl http2;
|
|
||||||
listen [::]:443 ssl http2;
|
|
||||||
server_name telefonia.itguys.com.br;
|
|
||||||
|
|
||||||
# --- CONFIGURAÇÕES DE SSL E SEGURANÇA ---
|
|
||||||
ssl_certificate /etc/letsencrypt/live/telefonia.itguys.com.br/fullchain.pem; # managed by Certbot
|
|
||||||
ssl_certificate_key /etc/letsencrypt/live/telefonia.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/telefonia.itguys.com.br.access.log;
|
|
||||||
error_log /var/log/nginx/telefonia.itguys.com.br.error.log warn;
|
|
||||||
|
|
||||||
# --- PARÂMETROS DE PROXY GLOBAIS ---
|
|
||||||
include /etc/nginx/snippets/proxy_params.conf;
|
|
||||||
|
|
||||||
# ==========================================================================
|
|
||||||
# INÍCIO DAS CORREÇÕES (V2)
|
|
||||||
# ==========================================================================
|
|
||||||
|
|
||||||
# [NOVA REGRA] Bloco para TODOS os arquivos estáticos sob /mbilling/.
|
|
||||||
# Esta regra é mais ampla e vai capturar todos os recursos necessários.
|
|
||||||
# Desativamos o ModSecurity aqui para evitar os bloqueios 403 e 404.
|
|
||||||
location ~* ^/mbilling/.*\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|json)$ {
|
|
||||||
# Desativa o ModSecurity apenas para estes arquivos seguros.
|
|
||||||
modsecurity off;
|
|
||||||
|
|
||||||
proxy_pass http://magnusbilling_backend;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rota principal para a aplicação, onde a lógica PHP é executada.
|
|
||||||
# O ModSecurity permanecerá ATIVO aqui, protegendo a aplicação.
|
|
||||||
location /mbilling/ {
|
|
||||||
# Habilita o suporte a WebSockets.
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
|
|
||||||
proxy_pass http://magnusbilling_backend;
|
|
||||||
}
|
|
||||||
|
|
||||||
# ==========================================================================
|
|
||||||
# FIM DAS CORREÇÕES (V2)
|
|
||||||
# ==========================================================================
|
|
||||||
|
|
||||||
# --- Páginas de Erro Personalizadas ---
|
|
||||||
include /etc/nginx/snippets/custom_errors.conf;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue