Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ postMatch="on"
whiteModule="on"
black_fileExt={"php","jsp"}
ipWhitelist={"127.0.0.1"}
servernameWhitelist={"www.xx.com"}
ipBlocklist={"1.0.0.1"}
CCDeny="off"
CCrate="100/60"
Expand Down
12 changes: 12 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,15 @@ function blockip()
end
return false
end

function whiteSvrName()
if next(servernameWhitelist) ~= nil then
for _,svrname in pairs(servernameWhitelist) do
if ngx.var.server_name == svrname then
return true
end
end
end
return false
end

1 change: 1 addition & 0 deletions waf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local method=ngx.req.get_method()
local ngxmatch=ngx.re.match
if whiteip() then
elseif blockip() then
elseif whiteSvrName() then
elseif denycc() then
elseif ngx.var.http_Acunetix_Aspect then
ngx.exit(444)
Expand Down