From c2fea8d6c13c49d369f1ed6d5073615b9ea28d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=89=E5=AE=89=E7=A7=91=E6=8A=80?= Date: Thu, 19 Sep 2024 18:04:40 +0800 Subject: [PATCH] update --- rules/force-https.lua | 2 +- rules/geo-block.lua | 2 +- rules/ip-block.lua | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rules/force-https.lua b/rules/force-https.lua index fd50d2a..149ae2d 100644 --- a/rules/force-https.lua +++ b/rules/force-https.lua @@ -10,6 +10,6 @@ if waf.scheme == "http" then - return waf.redirect("https://" .. waf.host) + return waf.redirect("https://" .. waf.host .. waf.reqUri) end return false \ No newline at end of file diff --git a/rules/geo-block.lua b/rules/geo-block.lua index 81a91ff..7e59cf2 100644 --- a/rules/geo-block.lua +++ b/rules/geo-block.lua @@ -14,7 +14,7 @@ if waf.contains(waf.ip,":") then end local country, province, city = waf.ip2loc(waf.ip) -if country and country ~= "中国" then +if country ~= "中国" and country ~= "内网IP" then return true, "限制非中国地区访问", true end return false diff --git a/rules/ip-block.lua b/rules/ip-block.lua index 2e2db96..0f82a9b 100644 --- a/rules/ip-block.lua +++ b/rules/ip-block.lua @@ -11,8 +11,8 @@ local ip = waf.ip -if waf.contains(ip,"10.20.11.193") then +if waf.startWith(ip,"10.20.11.") then return waf.block(true) -- 重置TCP连接,不记录日志 - end +end return false