Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

带正则的规则都不生效 #58

Open
Livenux opened this issue Aug 17, 2022 · 2 comments
Open

带正则的规则都不生效 #58

Livenux opened this issue Aug 17, 2022 · 2 comments

Comments

@Livenux
Copy link

Livenux commented Aug 17, 2022

系统信息:

现象:
只有ip.deny 生效,其他的模块都没有生效.

Nginx 错误日志:

2022/08/17 18:21:53 [warn] 14749#14749: *32 [lua] _G write guard:12: writing a global Lua variable ('aho-corasick') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
stack traceback:
        [C]: at 0x7f3c02604920
        [C]: in function 'require'
        /opt/openresty/openstar/lib/optl.lua:6: in main chunk
        [C]: in function 'require'
        /opt/openresty/openstar/i_worker.lua:128: in function </opt/openresty/openstar/i_worker.lua:127>, context: ngx.timer

启用的模块:

{"logPath":"\/opt\/openresty\/openstar\/logs\/","htmlPath":"\/opt\/openresty\/openstar\/index\/","code":"ok","autoSync":{"state":"Master\/Slave\/off","timeAt":5},"app_Mod":"on","log_conf":{"filename":"waf.log","state":"on","tb_formart":["$time","$remoteIp","$host","$ip","$method","$server_protocol","$status","$request_uri","$useragent","$referer","waf_log:","$waf_log","\n"],"tb_concat":" "},"referer_Mod":"on","jsonPath":"\/opt\/openresty\/openstar\/conf_json\/","uri_Mod":"on","realIpFrom_Mod":"on","header_Mod":"on","redis_Mod":{"Password":"","ip":"127.0.0.1","state":"on","Port":6379},"useragent_Mod":"on","network_Mod":"on","cookie_Mod":"on","Mod_state":"on","args_Mod":{"state":"on","HPP_state":"on"},"ip_Mod":"on","post_Mod":{"state":"on","HPP_state":"on"},"debug_Mod":false,"baseDir":"\/opt\/openresty\/openstar\/","post_form":10240,"replace_Mod":"off","host_method_Mod":"off","denyMsg":{"state":"on","msg":"openstar deny","http_code":403},"rewrite_Mod":"on","ngx_status":"on"}
@starjun
Copy link
Owner

starjun commented Aug 18, 2022

optl.lua 中使用了 aho 算法,对应这个算法的 aho-corasick.so 文件似乎没有加载成功,注释掉 optl.lua 中 使用 aho 算法的地方
image
image

@Livenux
Copy link
Author

Livenux commented Aug 21, 2022

aho-corasick.so

optl.lua 中使用了 aho 算法,对应这个算法的 aho-corasick.so 文件似乎没有加载成功,注释掉 optl.lua 中 使用 aho 算法的地方 image image

我测试了下aho-corasick.so ,在resty里面匹配不了,但是执行lua脚本又能匹配,这是因为新的luajit没法使用这个模块吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants