Commit 3f4300d3 by Joneq

增加代码

parent 44020065
Showing with 4 additions and 8 deletions
......@@ -23,6 +23,7 @@ local cjson = require "cjson"
-------去除一些不要验证的请求并获取url
local urlok,temp_uri = reqhandle.Selfwhiteurl()
if urlok == "ok" then
......@@ -31,8 +32,6 @@ if urlok == "ok" then
end
-------链接redis------------
local red = redis:new()
red:set_timeout(1000)
......@@ -93,14 +92,10 @@ if wafcheck.WhiteIp(user_ip) == 'exist' or wafcheck.WhiteUrl(temp_uri) == 'exist
end
-- 黑名单存在直接302
if wafcheck.BlackIp(user_ip) == 'exist' or wafcheck.BlackUrl(temp_uri) == 'exist' or wafcheck.BlackHeader(user_ip) == 'exist' then
return
end
-- 黑名单
is_black ,err = red:sismember('spider_black_list', user_ip)
if is_black == 1 then
red:close()
ngx.exit(ngx.HTTP_FORBIDDEN)
return
......@@ -109,6 +104,7 @@ end
-------s------------------------20200923新增对用户特定URL,IP时间段内的限制-------s------------------------
--[[
1 设置需要的请求网址 redis 集合 waf_urldesc_limit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment