fix redirect
This commit is contained in:
parent
f59d00e172
commit
20b8a99f14
|
@ -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
|
||||
|
|
Reference in New Issue