use ngx.var.host

This commit is contained in:
moicen
2023-05-07 02:19:43 +08:00
parent 13fc29e920
commit 5dcccae37d
+1 -9
View File
@@ -4,16 +4,8 @@ package.path = package.path .. ';<SCRIPT_PATH>/?.lua';
local _M = {}
--local strip_path = require("strip_path")
--local Upyun = require('upyun')
function host(s)
return (s.."/"):match("://(.-)/")
end
function _M.upt(uri)
local hostname = host(uri)
local hostname = ngx.var.host
local secret;
if (hostname == 'moicen.com') then