This is a follow on from:
http://mailman.nginx.org/pipermail/nginx/2011-October/029905.html
The conditional statements take care of the basic error but what
happens is that when “post” requests match any of the test regexes, an
error is thrown …
“lua handler aborted: runtime error: attempt to yield across
metamethod/C-call boundary blah, blah, blah”.
It appears this is due to a limitation in Lua 5.1 and this yeilding is
a major item for Lua 5.2. However, trying to build Nginx with the lua
module against Lua 5.2 fails…
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_conf.c
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:
In function ‘ngx_http_lua_new_thread’:
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:189:
error: ‘LUA_GLOBALSINDEX’ undeclared (first use in this function)
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:189:
error: (Each undeclared identifier is reported only once
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:189:
error: for each function it appears in.)
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:
In function ‘ngx_http_lua_del_thread’:
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:228:
warning: implicit declaration of function ‘lua_getfenv’
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:234:
warning: implicit declaration of function ‘lua_setfenv’
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:
In function ‘init_ngx_lua_globals’:
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:507:
error: ‘LUA_GLOBALSINDEX’ undeclared (first use in this function)
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:
In function ‘ngx_http_lua_discard_bufs’:
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:544:
warning: unused parameter ‘pool’
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:
In function ‘ngx_http_lua_set_multi_value_table’:
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_util.c:1167:
warning: implicit declaration of function ‘lua_objlen’
make[1]: *** [objs/addon/src/ngx_http_lua_util.o] Error 1
make[1]: *** Waiting for unfinished jobs…
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_conf.c:
In function ‘ngx_http_lua_merge_loc_conf’:
/usr/src/redhat/BUILD/nginx-1.0.8/ngx-lua-module-0.31rc17-0/src/ngx_http_lua_conf.c:95:
warning: unused parameter ‘cf’
make[1]: Leaving directory `/usr/src/redhat/BUILD/nginx-1.0.8’
make: *** [build] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.63523 (%build)
The upshot is that perhaps only LuaJIT 2.0 can be used for all
features in recent versions of ngx_lua.
Luckily, I took a backup of my server state so I’ll be rolling back
and commenting out the “post” block.