Add caching for texture requests: implement proxy and cache settings for texture assets
This commit is contained in:
@@ -19,6 +19,20 @@ server {
|
|||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
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
|
# Proxy WebSocket for browser clients
|
||||||
location /ws {
|
location /ws {
|
||||||
proxy_pass http://server:3001/ws;
|
proxy_pass http://server:3001/ws;
|
||||||
|
|||||||
Reference in New Issue
Block a user