Commit 3f4300d3 by Joneq

增加代码

parent 44020065
Showing with 5 additions and 9 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,18 +92,15 @@ 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
red:close()
ngx.exit(ngx.HTTP_FORBIDDEN)
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
end
......
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