Add texture proxy cache configuration to nginx

This commit is contained in:
MayaTheShy
2026-03-22 02:41:45 -04:00
parent 7a277a86eb
commit 1a6d32c16b

View File

@@ -5,6 +5,10 @@ server {
root /usr/share/nginx/html;
index index.html;
# Texture proxy cache zone (100MB, inactive entries purged after 7 days)
proxy_cache_path /tmp/nginx_texture_cache levels=1:2 keys_zone=textures:10m
max_size=100m inactive=7d use_temp_path=off;
# Serve static files, fallback to index.html for SPA routing
location / {
try_files $uri $uri/ /index.html;
@@ -27,6 +31,7 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Let the server set Cache-Control, but also cache at nginx level
proxy_cache textures;
proxy_cache_valid 200 7d;
proxy_cache_valid 404 1d;
expires 7d;