I fixed this. Some docs are wrong. I got it to work by moving set command inside location. I have no idea why it works now. Once I move it outside again, it becomes empty again.
On Sunday, February 11, 2018 at 3:52:29 AM UTC-6, Ronneil Camara wrote:
set $some_var "";
location /test {
content_by_lua_block {
ngx.var.some_var = "somestring"
}
return 200 $some_var;
}
When I visit on my browser, the value is still empty and not "somestring".