From 999a0d85aa858ecd8e783dc2068fb1bc70808dce Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 24 Aug 2021 16:42:33 +0200 Subject: [PATCH 1/2] expose /skynet/health endpoint --- docker/nginx/conf.d/client.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 73d6a6bf..6c05edc9 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -375,6 +375,13 @@ server { proxy_pass http://siad; } + location /skynet/health { + include /etc/nginx/conf.d/include/cors; + + proxy_set_header User-Agent: Sia-Agent; + proxy_pass http://siad; + } + location /skynet/resolve { include /etc/nginx/conf.d/include/cors; From 3b4a6bbd581a6debd17e9e958ad6561690065cdc Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 24 Aug 2021 19:02:11 +0200 Subject: [PATCH 2/2] extend timeout on health endpoint and cache result for 1 minute --- docker/nginx/conf.d/client.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 6c05edc9..ce0bd4e0 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -378,7 +378,11 @@ server { location /skynet/health { include /etc/nginx/conf.d/include/cors; + proxy_cache skynet; + proxy_cache_key $request_uri; # use whole request uri (uri + args) as cache key + proxy_cache_valid any 1m; # cache any response for 1 minute proxy_set_header User-Agent: Sia-Agent; + proxy_read_timeout 5m; # extend the read timeout to 5 minutes proxy_pass http://siad; }