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

启动后应用一直500 #32

Open
williamwxx opened this issue Dec 16, 2020 · 3 comments
Open

启动后应用一直500 #32

williamwxx opened this issue Dec 16, 2020 · 3 comments

Comments

@williamwxx
Copy link

2020/12/16 10:11:23 [warn] 6630#0: *36 [lua] _G write guard:12: __newindex(): writing a global lua variable ('CLIENT_IP') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
stack traceback:
/home/openresty/openresty/waf/lib.lua:11: in function 'get_client_ip'
/home/openresty/openresty/waf/init.lua:63: in function 'cc_attack_check'
/home/openresty/openresty/waf/access.lua:7: in function 'waf_main'
/home/openresty/openresty/waf/access.lua:18: in main chunk, client:

@WPFS
Copy link

WPFS commented Dec 25, 2020

这是因为你声明了一个全局变量。
lua建议使用local 局部变量

@dqzboy
Copy link

dqzboy commented Feb 19, 2023

这是因为你声明了一个全局变量。 lua建议使用local 局部变量

那请问如何解决呢?

@linuxxing
Copy link

检查一下 waf 目录下的 config.lua 配置文件。config_rule_dir 这个路径对不对。

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

4 participants