From a9d36a503ac38da14056d1bdd4bcb73d0c343e11 Mon Sep 17 00:00:00 2001 From: "srvproxy001.itguys.com.br" Date: Mon, 22 Sep 2025 14:18:10 -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-22=2014:18:10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cloud.grupopralog.com.br.conf | 142 ------------------ 1 file changed, 142 deletions(-) delete mode 100644 nginx/sites-available/cloud.grupopralog.com.br.conf diff --git a/nginx/sites-available/cloud.grupopralog.com.br.conf b/nginx/sites-available/cloud.grupopralog.com.br.conf deleted file mode 100644 index afb8c73..0000000 --- a/nginx/sites-available/cloud.grupopralog.com.br.conf +++ /dev/null @@ -1,142 +0,0 @@ -# ============================================================================== -# ARQUIVO DE CONFIGURAÇÃO NGINX PARA NEXTCLOUD E OFFICE ONLINE -# DOMÍNIO: cloud.grupopralog.com.br -# AUTOR: Gemini AI (Especialista NGINX) -# VERSÃO: 3.1 -# ============================================================================== - -# ------------------------------------------------------------------------------ -# A. UPSTREAMS -# ------------------------------------------------------------------------------ -upstream nextcloud_backend { - server 172.16.253.12; -} - -upstream office_backend { - server 172.16.253.101; -} - -# ============================================================================== -# B. BLOCO HTTP: Redirecionar para HTTPS -# ============================================================================== -server { - listen 80; - listen [::]:80; - server_name cloud.grupopralog.com.br; - - # Desafio para renovação de certificado Let's Encrypt - location /.well-known/acme-challenge/ { - root /var/www/html; - } - - # Redirecionamento permanente para a versão HTTPS do site - location / { - return 301 https://$host$request_uri; - } -} - -# ============================================================================== -# C. BLOCO HTTPS: Servidor Principal -# ============================================================================== -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name cloud.grupopralog.com.br; - - # -------------------------------------------------------------------------- - # D. PARÂMETROS DE SSL/TLS E SEGURANÇA - # -------------------------------------------------------------------------- - ssl_certificate /etc/letsencrypt/live/cloud.grupopralog.com.br/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/cloud.grupopralog.com.br/privkey.pem; - include /etc/nginx/snippets/ssl_params.conf; - - add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always; - add_header X-Content-Type-Options nosniff always; - add_header X-Frame-Options "SAMEORIGIN" always; - add_header X-Permitted-Cross-Domain-Policies none always; - add_header X-Robots-Tag "noindex, nofollow" always; - add_header X-XSS-Protection "1; mode=block" always; - - # -------------------------------------------------------------------------- - # E. PARÂMETROS GERAIS DO SERVIDOR - # -------------------------------------------------------------------------- - client_max_body_size 10G; - access_log /var/log/nginx/access.log detailed_proxy; - error_log /var/log/nginx/error.log; - include /etc/nginx/snippets/custom_errors.conf; - include /etc/nginx/snippets/global_robots.conf; - - # -------------------------------------------------------------------------- - # H. ROTAS ESPECÍFICAS (LOCATIONS) - # -------------------------------------------------------------------------- - - # H.1. Rota para redirecionamentos de CalDAV e CardDAV - location = /.well-known/carddav { return 301 $scheme://$host/remote.php/dav; } - location = /.well-known/caldav { return 301 $scheme://$host/remote.php/dav; } - - # -------------------------------------------------------------------------- -# J. ROTAS DO OFFICE ONLINE (VERSÃO DEFINITIVA E EXPLÍCITA) -# -------------------------------------------------------------------------- - -# J.1. Bloqueio da telemetria que causa erros no editor -location = /we/RemoteTelemetry.ashx { - return 204; -} - -# J.2. Rota de descoberta do serviço Office (discovery) com correção do XML -location ^~ /hosting/discovery { - proxy_pass http://office_backend/hosting/discovery; - proxy_set_header Host $host; - - # Corrige as URLs incorretas geradas pelo Office Online no XML - sub_filter_once off; - sub_filter_types text/xml; - sub_filter 'https://srvoffice001.itguys.com.br/' 'https://cloud.grupopralog.com.br/'; - sub_filter 'https://srvoffice001/' 'https://cloud.grupopralog.com.br/'; - sub_filter 'https://172.16.253.101/' 'https://cloud.grupopralog.com.br/'; - sub_filter 'http://srvoffice001.itguys.com.br/' 'https://cloud.grupopralog.com.br/'; - sub_filter 'http://srvoffice001/' 'https://cloud.grupopralog.com.br/'; -} - -# J.3. Rota WOPI para manipulação de arquivos -location ^~ /hosting/wopi { - proxy_pass http://office_backend; - proxy_set_header Host $host; -} - -# J.4. Rota para Word, Excel, PowerPoint e outros recursos -# Captura qualquer URL que comece com os prefixos específicos do Office. -location ~ ^/(we|wv|x|p|o|op|m|lo)/ { - proxy_pass http://office_backend; - proxy_set_header Host $host; - include /etc/nginx/snippets/websocket_params.conf; -} - - # -------------------------------------------------------------------------- - # H.2. Rota Principal da Aplicação Nextcloud - # -------------------------------------------------------------------------- - location / { - # G. Tratamento de URLs amigáveis - rewrite ^\/\.well-known\/(card|cal)dav /remote.php/dav/ permanent; - rewrite ^(\/remote\/.+)(\/)$ $1 permanent; - - # Passa a requisição para o backend - proxy_pass http://nextcloud_backend; - - # F. Cabeçalhos de Proxy - 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 X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; - - # Parâmetros adicionais de proxy - proxy_http_version 1.1; - proxy_connect_timeout 60s; - proxy_read_timeout 3600s; - proxy_send_timeout 3600s; - proxy_buffering off; - proxy_request_buffering off; - } -}