-
Notifications
You must be signed in to change notification settings - Fork 139
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
Accessing testcookie_ok variable from log_by_lua_block #67
Comments
Have you tried to change modules ordering during nginx compilation? |
Yes, I tried both |
@tokumeo have you tried to use pre-built packages of nginx with Lua from openresty.org? |
No, I haven't tried that |
I've managed to work around this problem using |
@tokumeo Can you share example? |
I have a use case for setting another variable depending on the value of testcookie_ok variable. I'm trying to achieve this with lua-nginx-module by using log_by_lua_block directive. Unfortunately, when reading testcookie_ok from lua using ngx.var API from log_by_lua_block, the value of testcookie_ok is always nil. But when adding testcookie_ok to access log, the value is either "0" or "1" depending on the results of the validation. Could you please provide some insight on why testcookie_ok might be nil when reading it from log_by_lua_block?
Here are the logs:
I've tried compiling nginx with different order of testcookie and lua-nginx modules, but the situation doesn't change.
The text was updated successfully, but these errors were encountered: