[Auto-Sync] Atualização das configurações em srvproxy001.itguys.com.br - 2025-10-01 14:52:31
This commit is contained in:
parent
ee8e480f0e
commit
43f28ff23f
|
|
@ -267,15 +267,15 @@ server {
|
||||||
proxy_buffering on; # Buffering é bom para pequenas respostas de API
|
proxy_buffering on; # Buffering é bom para pequenas respostas de API
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(ocs/v[12].php/cloud/users|ocs/v[12].php/privatedata/get|ocs/v2.php/apps/notifications/api/v2/notifications) {
|
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|ocs/v[12].php/privatedata/get/userinfo) {
|
||||||
# Usar a mesma configuração de cache
|
# Usar a mesma configuração de cache
|
||||||
proxy_cache nextcloud_cache;
|
proxy_cache nextcloud_cache;
|
||||||
|
|
||||||
# Usar a mesma chave segura: host + URI + ID da Sessão
|
# Usar a mesma chave segura: host + URI + ID da Sessão
|
||||||
proxy_cache_key "$host$request_uri|$cookie_nc_session_id";
|
proxy_cache_key "$host$request_uri|$cookie_nc_session_id";
|
||||||
|
|
||||||
# Cache muito curto (1 segundo) para evitar vazamento e garantir frescor
|
# Cache muito curto (5 segundo) para evitar vazamento e garantir frescor
|
||||||
proxy_cache_valid 200 1s;
|
proxy_cache_valid 200 5s;
|
||||||
|
|
||||||
# Tratar erros e timeouts
|
# Tratar erros e timeouts
|
||||||
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
|
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
|
||||||
|
|
@ -294,35 +294,6 @@ server {
|
||||||
proxy_buffering on;
|
proxy_buffering on;
|
||||||
}
|
}
|
||||||
|
|
||||||
# --- Micro-caching Otimizado para APIs Nextcloud de montagem de Interface ---
|
|
||||||
location ~ ^/(ocs/v[12].php/cloud/apps|ocs/v[12].php/privatedata/get|ocs/v2.php/apps/notifications/api/v2/notifications|ocs/v[12].php/cloud/user|ocs/v[12].php/privatedata/get/userinfo) {
|
|
||||||
proxy_cache nextcloud_cache;
|
|
||||||
|
|
||||||
# Chave Segura com ID da Sessão, focando no que é essencial
|
|
||||||
proxy_cache_key "$host$request_uri|$cookie_nc_session_id";
|
|
||||||
|
|
||||||
# Cache muito curto (1 a 5 segundos)
|
|
||||||
proxy_cache_valid 200 5s;
|
|
||||||
|
|
||||||
# Bloqueio de Cache para métodos que alteram dados
|
|
||||||
if ($request_method = POST) {
|
|
||||||
proxy_cache_bypass 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
|
|
||||||
add_header X-APIMicroCache-Status $upstream_cache_status;
|
|
||||||
|
|
||||||
# Configurações de Proxy
|
|
||||||
proxy_pass http://nextcloud_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
# --- Rota Principal da Aplicação Nextcloud ---
|
# --- Rota Principal da Aplicação Nextcloud ---
|
||||||
location / {
|
location / {
|
||||||
# --- CORREÇÃO: Lógica de Cache de Sessão ---
|
# --- CORREÇÃO: Lógica de Cache de Sessão ---
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue