pull/63/head
ibuler 2016-06-19 11:50:57 +08:00
parent 8e4fc1657f
commit 41a6d8cec9
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ ip_black_list = {}
--------- Init project ---------------- --------- Init project ----------------
require 'init' require 'init'
--------- Access control limit -------- --------- Access control limit --------
if ip_check and (whiteIP(ip_white_list) or blackIP(ip_black_list)) then if ip_check and (whiteIP(ip_white_list, debug) or blackIP(ip_black_list, debug)) then
elseif cc_deny and denyCC(cc_rate, cc_deny_seconds) then elseif cc_deny and denyCC(cc_rate, cc_deny_seconds, debug) then
else return else return
end end

View File

@ -187,7 +187,7 @@ end
-- return false -- return false
-- end -- end
function denyCC(cc_rate, cc_deny_seconds) function denyCC(cc_rate, cc_deny_seconds, debug)
local uri = ngx.var.uri local uri = ngx.var.uri
cc_count = tonumber(string.match(cc_rate, '(.*)/')) cc_count = tonumber(string.match(cc_rate, '(.*)/'))
cc_seconds = tonumber(string.match(cc_rate, '/(.*)')) cc_seconds = tonumber(string.match(cc_rate, '/(.*)'))