diff --git a/nginx/sites-available/verbocloud.itguys.com.br.conf b/nginx/sites-available/verbocloud.itguys.com.br.conf index f418369..98bdd3e 100644 --- a/nginx/sites-available/verbocloud.itguys.com.br.conf +++ b/nginx/sites-available/verbocloud.itguys.com.br.conf @@ -190,24 +190,23 @@ server { 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 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)$ {