From e132bed24c27cc748f12b459468119bb86bbcf4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ku=C5=9B?= Date: Mon, 18 Aug 2025 19:51:12 +0200 Subject: [PATCH] + proxy_cache_path /var/cache/nginx2GB levels=1:2 keys_zone=GLOBAL_CACHE:256m inactive=7d max_size=2g use_temp_path=off loader_threshold=300 loader_sleep=50; i INNE --- nginx-config/https/https-bodypainter-eu.conf | 34 ++++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/nginx-config/https/https-bodypainter-eu.conf b/nginx-config/https/https-bodypainter-eu.conf index 6b2b0d9..7536ff3 100755 --- a/nginx-config/https/https-bodypainter-eu.conf +++ b/nginx-config/https/https-bodypainter-eu.conf @@ -3,10 +3,16 @@ # Konfiguracja cache (nowa część) proxy_cache_path /var/cache/nginx05GB levels=1:2 keys_zone=STATIC:50m inactive=24h max_size=500m use_temp_path=off; - proxy_cache_path /var/cache/nginx2GB levels=1:2 keys_zone=MEDIA:100m inactive=7d max_size=2g use_temp_path=off; - error_log /var/log/nginx/error.log notice; - + proxy_cache_path /var/cache/nginx2GB + levels=1:2 + keys_zone=GLOBAL_CACHE:256m + inactive=7d + max_size=2g + use_temp_path=off + loader_threshold=300 + loader_sleep=50; + server { listen 443 ssl; server_name www.bodypainter.eu; @@ -41,20 +47,28 @@ proxy_set_header X-Forwarded-Port $server_port; } - # Nowe lokacje dla cache'owania location ~* \.(jpg|jpeg|png|gif|ico|webp)$ { proxy_pass http://arti24-container:3000; - proxy_cache MEDIA; + proxy_cache GLOBAL_CACHE; proxy_cache_valid 200 30d; - proxy_cache_use_stale error timeout updating; + proxy_cache_min_uses 2; proxy_cache_lock on; + proxy_cache_lock_timeout 3s; proxy_cache_key "$scheme$host$request_uri"; - add_header X-Cache-Status $upstream_cache_status always; + add_header X-Cache-Status $upstream_cache_status; + + # Lepsza obsługa nagłówków + proxy_ignore_headers "Set-Cookie"; + proxy_cache_bypass $http_cache_purge; + + # Optymalizacja buforowania + open_file_cache max=1000 inactive=20s; + open_file_cache_valid 30s; + open_file_cache_min_uses 2; + open_file_cache_errors on; + expires 1y; access_log off; - - proxy_ignore_headers Cache-Control Set-Cookie; - proxy_hide_header Set-Cookie; } } \ No newline at end of file