+ 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
This commit is contained in:
Artur Kuś 2025-08-18 19:51:12 +02:00
parent 60b484b771
commit e132bed24c
1 changed files with 24 additions and 10 deletions

View File

@ -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;
}
}