{"action":"created","issue":{"url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/595","labels_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/595/labels{/name}","comments_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/595/comments","events_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/595/events","html_url":"https://github.com/openresty/lua-nginx-module/issues/595","id":114706233,"number":595,"title":"ngx.var documentation","user":{"login":"pirogoeth","id":472488,"avatar_url":"https://avatars.githubusercontent.com/u/472488?v=3","gravatar_id":"","url":"https://api.github.com/users/pirogoeth","html_url":"https://github.com/pirogoeth","followers_url":"https://api.github.com/users/pirogoeth/followers","following_url":"https://api.github.com/users/pirogoeth/following{/other_user}","gists_url":"https://api.github.com/users/pirogoeth/gists{/gist_id}","starred_url":"https://api.github.com/users/pirogoeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pirogoeth/subscriptions","organizations_url":"https://api.github.com/users/pirogoeth/orgs","repos_url":"https://api.github.com/users/pirogoeth/repos","events_url":"https://api.github.com/users/pirogoeth/events{/privacy}","received_events_url":"https://api.github.com/users/pirogoeth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-02T23:15:41Z","updated_at":"2015-11-05T02:46:47Z","closed_at":null,"body":"This is just a minor thing, but I think the [ngx.var documentation](https://github.com/openresty/lua-nginx-module#ngxvarvariable) should mention that an empty string is returned rather than a `nil` when you attempt to call when the variable you're checking for doesn't exist. \r\n\r\nAs a brief side note (or side question, rather), why doesn't the `ngx.var` API follow typical Lua semantics and return a `nil` for variables that don't exist?"},"comment":{"url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/comments/153938245","html_url":"https://github.com/openresty/lua-nginx-module/issues/595#issuecomment-153938245","issue_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/595","id":153938245,"user":{"login":"agentzh","id":56241,"avatar_url":"https://avatars.githubusercontent.com/u/56241?v=3","gravatar_id":"","url":"https://api.github.com/users/agentzh","html_url":"https://github.com/agentzh","followers_url":"https://api.github.com/users/agentzh/followers","following_url":"https://api.github.com/users/agentzh/following{/other_user}","gists_url":"https://api.github.com/users/agentzh/gists{/gist_id}","starred_url":"https://api.github.com/users/agentzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agentzh/subscriptions","organizations_url":"https://api.github.com/users/agentzh/orgs","repos_url":"https://api.github.com/users/agentzh/repos","events_url":"https://api.github.com/users/agentzh/events{/privacy}","received_events_url":"https://api.github.com/users/agentzh/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T02:46:47Z","updated_at":"2015-11-05T02:46:47Z","body":"@pirogoeth Okay, I see what is going on here. So uninitialized nginx variables are different from undefined nginx variables. Your `$var_thing` variable is defined (though in another location) but not initialized in `location /test/novar`; and uninitialized nginx variables all have the default initial value, an empty string. So this is the expected behaviour."}}