From 85e28dbc3f6f36fcceefeb741a68709f24af1e59 Mon Sep 17 00:00:00 2001 From: PJ Date: Thu, 3 Mar 2022 13:28:39 +0100 Subject: [PATCH] Expose cache header --- docker/nginx/conf.d/server/server.api | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/nginx/conf.d/server/server.api b/docker/nginx/conf.d/server/server.api index 532a1549..c57ef789 100644 --- a/docker/nginx/conf.d/server/server.api +++ b/docker/nginx/conf.d/server/server.api @@ -46,6 +46,8 @@ location /docs { location /skynet/blocklist { include /etc/nginx/conf.d/include/cors; + add_header X-Proxy-Cache $upstream_cache_status; + proxy_cache skynet; proxy_cache_valid any 1m; # cache blocklist for 1 minute proxy_set_header User-Agent: Sia-Agent; @@ -55,6 +57,8 @@ location /skynet/blocklist { location /skynet/portal/blocklist { include /etc/nginx/conf.d/include/cors; + add_header X-Proxy-Cache $upstream_cache_status; + proxy_cache skynet; proxy_cache_valid any 15m; # cache portal blocklist for 15 minutes proxy_pass http://blocker:4000/blocklist; @@ -63,6 +67,8 @@ location /skynet/portal/blocklist { location /skynet/portals { include /etc/nginx/conf.d/include/cors; + add_header X-Proxy-Cache $upstream_cache_status; + proxy_cache skynet; proxy_cache_valid any 1m; # cache portals for 1 minute proxy_set_header User-Agent: Sia-Agent; @@ -72,6 +78,8 @@ location /skynet/portals { location /skynet/stats { include /etc/nginx/conf.d/include/cors; + add_header X-Proxy-Cache $upstream_cache_status; + proxy_cache skynet; proxy_cache_valid any 1m; # cache stats for 1 minute proxy_set_header User-Agent: Sia-Agent; @@ -97,6 +105,8 @@ location /serverload { location /skynet/health { include /etc/nginx/conf.d/include/cors; + add_header X-Proxy-Cache $upstream_cache_status; + proxy_cache skynet; proxy_cache_key $request_uri; # use whole request uri (uri + args) as cache key proxy_cache_valid any 1m; # cache responses for 1 minute