pull/63/head
ibuler 2016-06-18 19:11:28 +08:00
parent 4d96926d19
commit 7890ae1c44
1 changed files with 8 additions and 2 deletions

View File

@ -265,8 +265,11 @@ function whiteIP()
ip = getClientIp()
for _, wip in pairs(ip_white_list) do
if ip == wip or innet(ip, wip) then
return true
end
+ if debug then
+ ngx.say(ip.."in white list <br />")
+ end
return true
end
end
end
return false
@ -277,6 +280,9 @@ function blackIP()
ip = getClientIp()
for _, bip in pairs(ip_black_list) do
if ip == bip or ip == "0.0.0.0" or innet(ip, bip) then
if debug then
+ ngx.say(ip.."in black list <br/>")
+ end
ngx.exit(403)
return true
end