From 776be50de90cb6963655cc61a5fb43c6fa5152a1 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Fri, 6 Aug 2021 16:52:18 +0200 Subject: [PATCH] fix broken skylink v2 redirects --- 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 a33055cc..fb8b67b9 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -446,6 +446,10 @@ server { proxy_read_timeout 600; proxy_set_header User-Agent: Sia-Agent; + # in case the requested skylink was v2 and we already resolved it to skylink v1, we're going to pass resolved + # skylink v1 to skyd to save that extra skylink v2 lookup in skyd but in turn, in case skyd returns a redirect + # we need to rewrite the skylink v1 to skylink v2 in the location header with proxy_redirect + proxy_redirect $skylink_v1 $skylink_v2; proxy_pass http://siad/skynet/skylink/$skylink_v1$path$is_args$args; }