I'm using lua nginx module in my nginx conf file. I'm trying to set a value variable during runtime depending on some injected parameters. However, I can not return a boolean from the block without converting it into a string. I'm trying to optimize this part by trying to remove this redundant string conversion.
This one works
location /set_by_lua_block_example { set_by_lua_block $value { return tostring(false) } add_header X-value "$value"; content_by_lua_block { ngx.say('Printing from set_by_lua_block_example!') } } But this one doesn't.
location /set_by_lua_block_example { set_by_lua_block $value { return false } add_header X-value "$value"; content_by_lua_block { ngx.say('Printing from set_by_lua_block_example!') } }