sdf
parent
48335cb152
commit
73dc10d827
|
@ -7,7 +7,7 @@ cc_rate = '10/60'
|
||||||
--------- Init project ----------------
|
--------- Init project ----------------
|
||||||
require 'init'
|
require 'init'
|
||||||
--------- Access control limit --------
|
--------- Access control limit --------
|
||||||
if cc_deny and denyCC(cc_rate, cc_deny_seconds) then
|
if ip_check and (whiteIP() or blackIP()) then
|
||||||
elseif ip_check and (whiteIP() or blackIP()) then
|
elseif cc_deny and denyCC() then
|
||||||
else return
|
else return
|
||||||
end
|
end
|
||||||
|
|
2
init.lua
2
init.lua
|
@ -187,7 +187,7 @@ end
|
||||||
-- return false
|
-- return false
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
function denyCC(cc_rate, cc_deny_seconds)
|
function denyCC()
|
||||||
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, '/(.*)'))
|
||||||
|
|
Loading…
Reference in New Issue