Add caching for texture requests: implement proxy and cache settings for texture assets

This commit is contained in:
MayaTheShy
2026-03-21 19:30:03 -04:00
parent 05f5a3519e
commit 3884b850c8

View File

@@ -19,6 +19,20 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
}
# Proxy and cache texture requests
location /api/texture/ {
proxy_pass http://server:3001/api/texture/;
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;
# Let the server set Cache-Control, but also cache at nginx level
proxy_cache_valid 200 7d;
proxy_cache_valid 404 1d;
expires 7d;
add_header X-Nginx-Cache $upstream_cache_status;
}
# Proxy WebSocket for browser clients
location /ws {
proxy_pass http://server:3001/ws;