chaoslawful/lua-nginx-module — Issue #74: set_by_lua and set_by_lua_file do not have ngx
Author: pkeenatemma
Created: 2011-12-07 15:55:04+00:00
State: open

I'm playing around with lua nginx and I've come across kind of a weird bug, if it actually is a bug. I can't seem to get set_by_lua to work. It doesn't appear to have a populated ngx table. Am I doing something wrong?

Version:
nginx: nginx version: ngx_openresty/1.0.9.10

Config:

worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
listen 8080;
location /works {
content_by_lua 'ngx.say("hi")';
}
location /does_not_work {
set_by_lua $loc 'ngx.say("hi")';
echo $loc;
}
}
}

Error:

2011/12/07 07:52:13 [error] 56498#0: *48 (lua-error) [string "content_by_lua"]:1: attempt to call field 'say' (a nil value), client: 127.0.0.1, server: , request: "GET /does_not_work HTTP/1.1", host: "localhost:8080"