ops: Add new nginx hot cacher

This commit is contained in:
wiz
2024-01-26 10:40:21 -05:00
parent c7862e19c2
commit 5a7a78cddc
3 changed files with 23 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ location /api/v1/mining {
try_files /dev/null @mempool-api-v1-cache-warm;
}
location /api/v1/fees/recommended {
try_files /dev/null @mempool-api-v1-cache-warm;
try_files /dev/null @mempool-api-v1-cache-hot;
}
# it's ok to cache blockchain data "forever", so we do 30d
@@ -84,6 +84,21 @@ location @mempool-api-v1-cache-forever {
expires 30d;
}
location @mempool-api-v1-cache-hot {
proxy_pass $mempoolMainnet;
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;
proxy_cache_background_update on;
proxy_cache_use_stale updating;
proxy_cache api;
proxy_cache_valid 200 1s;
proxy_redirect off;
}
location @mempool-api-v1-cache-warm {
proxy_pass $mempoolMainnet;