diff --git a/nginx/sites-available/verbocloud.itguys.com.br.conf b/nginx/sites-available/verbocloud.itguys.com.br.conf index 98bdd3e..da4d0c8 100644 --- a/nginx/sites-available/verbocloud.itguys.com.br.conf +++ b/nginx/sites-available/verbocloud.itguys.com.br.conf @@ -150,9 +150,10 @@ server { add_header 'Access-Control-Allow-Origin' "$scheme://$http_host"; add_header 'Access-Control-Allow-Credentials' 'true'; } - + # --------------------------------------------------- # REGRAS DO NEXTCLOUD AIO + # (Um único location / para capturar tudo) # --------------------------------------------------- # Redirecionamentos CalDAV/CardDAV @@ -161,82 +162,23 @@ server { location = /.well-known/webfinger { return 301 /index.php/.well-known/webfinger; } location = /.well-known/nodeinfo { return 301 /index.php/.well-known/nodeinfo; } - location /standalone-signaling/spreed { - proxy_pass http://nextcloud_aio_backend/standalone-signaling/spreed; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - } - - # --- API Micro-Cache (para Apps: Photos, Deck, Notes, Tasks) --- - # Cache da Árvore de Pastas (acelera o 'Files' e 'Photos') - location = /apps/files/api/v1/folder-tree { - proxy_pass http://nextcloud_aio_backend; - 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_http_version 1.1; - proxy_set_header Connection ""; # Re-use backend connections - proxy_buffering on; - - proxy_cache verbocloud_foldertree_cache; # <-- Usa cache exclusivo - proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args$cookie_nc_session_id"; - proxy_cache_valid 200 3s; # Cache curto (3 segundos) - proxy_cache_lock on; # Evita "thundering herd" - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; - - add_header 'X-Cache-FolderTree' $upstream_cache_status always; - } - - # Cache de APIs de Sessão (acelera 'Deck', 'Notes', 'Tasks', Notificações) - location ~ ^/(ocs/v[12].php/cloud/users|ocs/v[12].php/privatedata/get|ocs/v2.php/apps/notifications/api/v2/notifications|ocs/v[12].php/cloud/apps|ocs/v[12].php/cloud/user) { - proxy_pass http://nextcloud_aio_backend; - 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_http_version 1.1; - proxy_set_header Connection ""; - proxy_buffering on; - proxy_cache verbocloud_session_cache; # <-- Usa cache exclusivo - proxy_cache_key "$host$request_uri|$cookie_nc_session_id"; - proxy_cache_valid 200 5s; # Cache curto (5 segundos) - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; - - add_header 'X-Cache-API-Session' $upstream_cache_status always; - } - - # Cache de Estáticos (Opcional, mas bom para performance) - location ~ \.(css|js|svg|gif|png|jpg|ico|woff|woff2|tff)$ { - proxy_pass http://nextcloud_aio_backend; - 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_buffering on; - proxy_cache_valid 200 304 7d; - expires 7d; - add_header Cache-Control "public"; - } - # Regra Principal (Nextcloud AIO) location / { - proxy_pass http://nextcloud_aio_backend; # <-- Aponta para o AIO (HTTP) + proxy_pass http://nextcloud_aio_backend; 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; - # Recomendado pelo AIO para uploads/DAV + # --- Headers de WebSocket e Otimizações AIO --- + # (Isso garante que /push/, /whiteboard/ e /standalone-signaling/ funcionem) + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; proxy_buffering off; proxy_request_buffering off; - proxy_http_version 1.1; - + # Timeouts longos proxy_connect_timeout 3600s; proxy_send_timeout 3600s;