mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 07:50:45 +00:00
still allow nginx to cache root for 1 second
This commit is contained in:
+9
-5
@@ -175,17 +175,21 @@ server {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Root location with no caching
|
||||
|
||||
# Root location with short Nginx cache but no browser cache
|
||||
location = / {
|
||||
proxy_pass http://127.0.0.1:3000;
|
||||
|
||||
# Tell browsers not to cache
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires "0";
|
||||
|
||||
# Disable proxy cache for index.html
|
||||
proxy_no_cache 1;
|
||||
proxy_cache_bypass 1;
|
||||
# But let Nginx cache for 1 second to reduce load
|
||||
proxy_cache STATIC;
|
||||
proxy_cache_valid 200 302 1s;
|
||||
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
|
||||
proxy_cache_lock on;
|
||||
|
||||
# Show cache status in response headers
|
||||
add_header X-Cache-Status $upstream_cache_status;
|
||||
|
||||
Reference in New Issue
Block a user