Commit a1e6aa7b by Joneq

修改代码

parent d228e7b8
Showing with 4 additions and 2 deletions
......@@ -85,17 +85,19 @@ u_agent = ngx.req.get_headers().user_agent
-- 白名单存在直接跳过
if wafcheck.WhiteIp(user_ip) == 'exist' or wafcheck.WhiteUrl(temp_uri) == 'exist' or wafcheck.WhiteHeader(user_ip) == 'exist' then
if wafcheck.WhiteIp(user_ip) == 'exist' or wafcheck.WhiteUrl(temp_uri) == 'exist' or wafcheck.WhiteHeader(u_agent) == 'exist' then
return
end
ngx.say(wafcheck.BlackIp(user_ip))
red:close()
ngx.exit(ngx.HTTP_FORBIDDEN)
ngx.say(1)
-- 黑名单存在直接302
if wafcheck.BlackIp(user_ip) == 'exist' or wafcheck.BlackUrl(temp_uri) == 'exist' or wafcheck.BlackHeader(user_ip) == 'exist' then
if wafcheck.BlackIp(user_ip) == 'exist' or wafcheck.BlackUrl(temp_uri) == 'exist' or wafcheck.BlackHeader(u_agent) == 'exist' then
ngx.say(wafcheck.BlackIp(user_ip))
ngx.exit(ngx.HTTP_FORBIDDEN)
......
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