fix domain matching in upt
This commit is contained in:
@@ -17,11 +17,18 @@ function _M.upt(url)
|
|||||||
ngx.log(ngx.INFO, 'hostname...' .. hostname .. ' path...' .. pathname)
|
ngx.log(ngx.INFO, 'hostname...' .. hostname .. ' path...' .. pathname)
|
||||||
local secret;
|
local secret;
|
||||||
if string.find(hostname, "moicen.com") then
|
if string.find(hostname, "moicen.com") then
|
||||||
|
ngx.log(ngx.INFO, 'match moicen.com: ' .. ngx.var.upt_moicen_secret)
|
||||||
secret = ngx.var.upt_moicen_secret
|
secret = ngx.var.upt_moicen_secret
|
||||||
elseif string.find(hostname, "alchemy-studio.cn") then
|
elseif string.find(hostname, "alchemy-studio.cn") then
|
||||||
|
ngx.log(ngx.INFO, 'match alchemy-studio.cn: ' .. ngx.var.upt_alchemy_secret)
|
||||||
secret = ngx.var.upt_alchemy_secret
|
secret = ngx.var.upt_alchemy_secret
|
||||||
elseif string.find(hostname, "huiwings.cn") then
|
elseif string.find(hostname, "huiwings.cn") then
|
||||||
|
ngx.log(ngx.INFO, 'match huiwings.cn: ' .. ngx.var.upt_huiwings_secret)
|
||||||
secret = ngx.var.upt_huiwings_secret
|
secret = ngx.var.upt_huiwings_secret
|
||||||
|
else
|
||||||
|
ngx.status = 401
|
||||||
|
ngx.log(ngx.ERR, "Reject URL -> ", hostname)
|
||||||
|
ngx.exit(ngx.status)
|
||||||
end
|
end
|
||||||
|
|
||||||
ngx.log(ngx.INFO, 'secret...' .. secret)
|
ngx.log(ngx.INFO, 'secret...' .. secret)
|
||||||
|
|||||||
Reference in New Issue
Block a user