From 20b8a99f1430fab202b9b6db69de1327963cff2f Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 1 Jun 2021 12:56:11 +0200 Subject: [PATCH] fix redirect --- docker/nginx/conf.d/client.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index b688ce66..e6b981a8 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -470,7 +470,8 @@ server { header_filter_by_lua_block { if ngx.var.skylink_v1 ~= ngx.var.skylink_v2 then if ngx.header.location then - ngx.header.location = ngx.header.location:gsub(ngx.var.skylink_v1, ngx.var.skylink_v2) + local path = string.match(ngx.header.location, "[^/?]+(.*)"); + ngx.header.location = ngx.var.skylink_v2 .. path end ngx.header["Skynet-Skylink"] = ngx.var.skylink_v2 end