diff --git a/web/client/nginx.conf b/web/client/nginx.conf index 05fef61..f24cff5 100644 --- a/web/client/nginx.conf +++ b/web/client/nginx.conf @@ -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;