I'm trying to check if an nginx variable is set in lua. I'm doing
if ngx.var.myvar ~= "" then
...
end
where "myvar" isn't set in the nginx.conf. I'm getting
2014/03/07 14:09:50 [warn] 2127#0: *8 using uninitialized "myvar" variable, client: 127.0.0.1, server: localhost, request: "GET /no_cookies/index.html HTTP/1.1", host: "localhost:8080
in error.log. How do I test if the nginx variable is set?