pull/63/head
ibuler 2016-06-18 19:18:00 +08:00
parent 48335cb152
commit 73dc10d827
2 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ cc_rate = '10/60'
--------- Init project ----------------
require 'init'
--------- Access control limit --------
if cc_deny and denyCC(cc_rate, cc_deny_seconds) then
elseif ip_check and (whiteIP() or blackIP()) then
if ip_check and (whiteIP() or blackIP()) then
elseif cc_deny and denyCC() then
else return
end

View File

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