From b3f1d0503172d54a51f522a91a4136b9983d87d2 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Fri, 4 Mar 2022 18:36:07 +0100 Subject: [PATCH] properly handle case where ngx.var.args is nil --- docker/nginx/conf.d/server/server.api | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/nginx/conf.d/server/server.api b/docker/nginx/conf.d/server/server.api index d6f7a251..55bb0fe3 100644 --- a/docker/nginx/conf.d/server/server.api +++ b/docker/nginx/conf.d/server/server.api @@ -355,7 +355,8 @@ location ~ "^/(([a-zA-Z0-9-_]{46}|[a-z0-9]{55})(/.*)?)$" { rewrite_by_lua_block { local skynet_skylink = require("skynet.skylink") local base32_skylink = skynet_skylink.base32(ngx.var.skylink) - local base32_url = ngx.var.scheme .. "://" .. base32_skylink .. "." .. ngx.var.skynet_portal_domain .. ngx.var.path .. ngx.var.is_args .. ngx.var.args + local args = ngx.var.args and ngx.var.is_args .. ngx.var.args or "" + local base32_url = ngx.var.scheme .. "://" .. base32_skylink .. "." .. ngx.var.skynet_portal_domain .. ngx.var.path .. args return ngx.redirect(base32_url, ngx.HTTP_MOVED_PERMANENTLY) }