add whit host support
parent
c0b121a64c
commit
172b56505c
|
@ -6,9 +6,11 @@ Redirect="on"
|
|||
CookieMatch="on"
|
||||
postMatch="on"
|
||||
whiteModule="on"
|
||||
whiteHostModule="on"
|
||||
black_fileExt={"php","jsp"}
|
||||
ipWhitelist={"127.0.0.1"}
|
||||
ipBlocklist={"1.0.0.1"}
|
||||
hostWhiteList = {"www.xxx.com"}
|
||||
CCDeny="off"
|
||||
CCrate="100/60"
|
||||
html=[[
|
||||
|
|
15
init.lua
15
init.lua
|
@ -10,6 +10,7 @@ UrlDeny = optionIsOn(UrlDeny)
|
|||
PostCheck = optionIsOn(postMatch)
|
||||
CookieCheck = optionIsOn(cookieMatch)
|
||||
WhiteCheck = optionIsOn(whiteModule)
|
||||
WhiteHostCheck = optionIsOn(whiteHostModule)
|
||||
PathInfoFix = optionIsOn(PathInfoFix)
|
||||
attacklog = optionIsOn(attacklog)
|
||||
CCDeny = optionIsOn(CCDeny)
|
||||
|
@ -89,6 +90,20 @@ function whiteurl()
|
|||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function whitehost()
|
||||
if WhiteHostCheck then
|
||||
local items = Set(hostWhiteList)
|
||||
for host in pairs(items) do
|
||||
if ngxmatch(ngx.var.host, host, "isjo") then
|
||||
log('POST',ngx.var.request_uri,"-","white host".. host)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function fileExtCheck(ext)
|
||||
local items = Set(black_fileExt)
|
||||
ext=string.lower(ext)
|
||||
|
|
Loading…
Reference in New Issue