feat(attic): add nginx proxy cache to reduce S3 egress
Caches GET/HEAD responses up to 10 GB on disk with 30-day eviction. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f2afa78817
commit
510e3505a8
1 changed files with 13 additions and 0 deletions
|
|
@ -56,6 +56,14 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedTlsSettings = true;
|
||||||
|
appendHttpConfig = ''
|
||||||
|
proxy_cache_path /var/cache/nginx/attic
|
||||||
|
levels=1:2
|
||||||
|
keys_zone=attic:10m
|
||||||
|
max_size=10g
|
||||||
|
inactive=30d
|
||||||
|
use_temp_path=off;
|
||||||
|
'';
|
||||||
virtualHosts."attic.teepot.org" = {
|
virtualHosts."attic.teepot.org" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
|
|
@ -64,6 +72,11 @@
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
client_max_body_size 0;
|
client_max_body_size 0;
|
||||||
|
proxy_cache attic;
|
||||||
|
proxy_cache_valid 200 30d;
|
||||||
|
proxy_cache_use_stale error timeout updating;
|
||||||
|
proxy_cache_methods GET HEAD;
|
||||||
|
proxy_cache_bypass $request_method;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue