Thank you for your response.
Versions
nginx versions tried nginx/1.2.5 and nginx/1.3.9
LuaJIT 2.0.0
What I want achive?
Set the value of $cookie_abc to "a"/"b" (some logic) if the cookie value is not coming in the request else use the value set. I am doing this in
server level
set $cookie_abc "$cookie_abc";
set $tmp_abc "";
set_by_lua $tmp_abc '
common.set_abc_cookie()
';
I am using set_by_lua to make sure the cookie value is set before the rewrites are evaluated.
Why I am doing this?
I have used $cookie_abc variable in my config and I want to have "a"/"b" value depending on a logic if the cookie is not passed.
What is not working?
inside common.set_abc_cookie()
ngx.var.cookie_abc = "a" if the cookie is not passed.
This is expected. That is why I am doing
set $cookie_abc "$cookie_abc";
Versions
nginx versions tried nginx/1.2.5 and nginx/1.3.9
LuaJIT 2.0.0
What I want achive?
Set the value of $cookie_abc to "a"/"b" (some logic) if the cookie value is not coming in the request else use the value set. I am doing this in
server level
set $cookie_abc "$cookie_abc";
set $tmp_abc "";
set_by_lua $tmp_abc '
common.set_abc_cookie()
';
I am using set_by_lua to make sure the cookie value is set before the rewrites are evaluated.
Why I am doing this?
I have used $cookie_abc variable in my config and I want to have "a"/"b" value depending on a logic if the cookie is not passed.
What is not working?
inside common.set_abc_cookie()
ngx.var.cookie_abc = "a" if the cookie is not passed.
This is expected. That is why I am doing
set $cookie_abc "$cookie_abc";