From b3907f2f28213f01bdaf8f02b3ffcf18510b4373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=89=E5=AE=89=E7=A7=91=E6=8A=80?= Date: Fri, 23 Sep 2022 22:07:33 +0800 Subject: [PATCH] Update anti-cc.lua --- rules/anti-cc.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rules/anti-cc.lua b/rules/anti-cc.lua index 309a676..d572bd5 100644 --- a/rules/anti-cc.lua +++ b/rules/anti-cc.lua @@ -17,13 +17,13 @@ local sh = ngx.shared.ipCache local ccIp = 'cc-' .. waf.ip local c, f = sh:get(ccIp) if not c then - sh:set(ccIp, 0, 60, 1) -- 设置1分钟也就是60秒访问计数时间 + sh:set(ccIp, 1, 60, 1) -- 设置1分钟也就是60秒访问计数时间 else if f == 2 then - return true, ccIp, true + return waf.block(true) end sh:incr(ccIp, 1) - if c >= 360 then + if c + 1 >= 360 then sh:set(ccIp, c, 300, 2) -- 设置5分钟也就是300秒拦截时间 end end