文档中说,在access阶段调ngx.exit(),请求会继续下去,到content阶段
而且ngx.ctx只有在Internal redirection才会将ngx.ctx洗掉
location /test_ctx {
access_by_lua '
ngx.ctx.foo = 42
ngx.exit(ngx.OK)
';
content_by_lua 'ngx.say(ngx.ctx.foo)';
}
上面的代码预期返回42,实际是nil
如果将ngx.exit(ngx.OK)去掉,或者改成return,则返回预期的42
ngx.exit()会把处理过程认为是一个internal redirection吗?
是bug还是就是这么设计的?
nginx版本1.9.6,lua-nginx-module版本0.9.7