wmgm183 / ngx_lua_waf

loveshell的ngx_lua_waf后续维护,一个基于lua-nginx的web防火墙
10 stars 2 forks source link

CC功能测试出现问题【500 Internal Server Error】 #1

Open Lijuming33 opened 5 months ago

Lijuming33 commented 5 months ago

这是我的配置,ipWhitelist我把127.0.0.1改成了127.1.0.1让他失效,测试CC功能,前面测的一切正常,浏览器访问81频繁刷新之后打印了【频繁访问限制,请稍后再试】,我无视这信息继续频繁刷新请求,然后浏览器显示【500 Internal Server Error openresty/1.25.3.1】,即使我把ipWhitelist改成127.0.0.1之后又能正常访问,如果再把127.0.0.1移出白名单的话访问81端口就直接500错误了,是不是有黑名单存放文件?如果有这存放黑名单ip的文件在哪呢?config.lua中的ipBlocklist={"1.0.0.1"}列表没有写入更新。或许,这是一个bug?下面是我查看error.log的信息。 RulePath = "/usr/local/openresty/nginx/conf/waf" attacklog = "on" logdir = "/www/logs/nginx/hack" UrlDeny="on" Redirect="on" CookieMatch="on" postMatch="on" whiteModule="off" black_fileExt={"php","jsp"} ipWhitelist={"127.1.0.1"} ipBlocklist={"1.0.0.1"} CCDeny="on" CCrate="20/60"

(base) w@XiaoXin-15-Air:/usr/local/openresty/nginx/logs$ tail -f error.log 2024/05/19 13:44:33 [notice] 419844#419844: signal process started 2024/05/19 13:44:41 [error] 419855#419855: *2 lua entry thread aborted: runtime error: /usr/local/openresty/nginx/waf/init.lua:168: bad argument #1 to 'pairs' (table expected, got nil) stack traceback: coroutine 0: [C]: in function 'pairs' /usr/local/openresty/nginx/waf/init.lua:168: in function 'ua' /usr/local/openresty/nginx/waf/waf.lua:12: in main chunk, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "127.0.0.1:81"

Lijuming33 commented 5 months ago

而且我配置的日志目录logdir = "/www/logs/nginx/hack"没有生成任何文件,这个目录我设置了sudo chmod 777 -R /www权限的,有人能回答我的疑问吗?