pull/484/head
midoks 2 years ago
parent 0cec515297
commit b16ca19ca8
  1. 2
      plugins/op_waf/install.sh
  2. 13
      plugins/op_waf/waf/lua/init.lua

@ -2,7 +2,7 @@
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# cd /www/server/mdserver-web/plugins/op_waf && bash install.sh install 0.3.0
# cd /www/server/mdserver-web/plugins/op_waf && bash install.sh install 0.3.2
curPath=`pwd`
rootPath=$(dirname "$curPath")

@ -555,8 +555,6 @@ end
local geo=nil
local waf_country=""
local geo2=nil
local function initmaxminddb()
if geo==nil then
@ -594,8 +592,9 @@ end
local function get_country()
local ip = params['ip']
if ngx.shared.waf_limit:get("get_country"..ip) then
return ngx.shared.waf_limit:get("get_country"..ip)
local ip_local = ngx.shared.waf_limit:get("get_country"..ip)
if ip_local then
return ip_local
end
local ip_postion=get_ip_country(ip)
if ip_postion=="2" then return false end
@ -662,8 +661,10 @@ function run_app_waf()
-- C:D("min_route")
-- country limit
local waf_country = get_country()
if area_limit(waf_country, server_name, site_config[server_name]['open']) then return true end
if waf_country then
if area_limit(waf_country, server_name, site_config[server_name]['open']) then return true end
end
if site_config[server_name] and site_config[server_name]['open'] then

Loading…
Cancel
Save