use ngx.var.host
This commit is contained in:
+5
-5
@@ -6,17 +6,17 @@ local _M = {}
|
|||||||
|
|
||||||
function _M.upt(uri)
|
function _M.upt(uri)
|
||||||
local hostname = ngx.var.host
|
local hostname = ngx.var.host
|
||||||
|
ngx.log(ngx.INFO, 'hostname...', hostname)
|
||||||
local secret;
|
local secret;
|
||||||
if (hostname == 'moicen.com') then
|
if string.find(hostname, "moicen.com") then
|
||||||
secret = ngx.var.upt_moicen_secret
|
secret = ngx.var.upt_moicen_secret
|
||||||
elseif hostname == "alchemy-studio.cn" then
|
elseif string.find(hostname, "alchemy-studio.cn") then
|
||||||
secret = ngx.var.upt_alchemy_secret
|
secret = ngx.var.upt_alchemy_secret
|
||||||
elseif hostname == "huiwings.cn" then
|
elseif string.find(hostname, "huiwings.cn") then
|
||||||
secret = ngx.var.upt_huiwings_secret
|
secret = ngx.var.upt_huiwings_secret
|
||||||
end
|
end
|
||||||
|
|
||||||
ngx.log(ngx.INFO, 'url...' .. uri .. ' host...' .. hostname .. 'secret...' .. secret)
|
ngx.log(ngx.INFO, 'secret...' .. secret)
|
||||||
local duration = ngx.var.upt_duration
|
local duration = ngx.var.upt_duration
|
||||||
local etime = os.time() + duration
|
local etime = os.time() + duration
|
||||||
local sign = ngx.md5(secret .. '&' .. etime .. '&' .. uri)
|
local sign = ngx.md5(secret .. '&' .. etime .. '&' .. uri)
|
||||||
|
|||||||
Reference in New Issue
Block a user