So is "rewrite_by_lua" also evil?

agentzh agentzh at
Fri Oct 14 00:36:09 UTC 2011

On Fri, Oct 14, 2011 at 12:10 AM, Nginx User <nginx at> wrote:
> Rebuilt with 0.31rc11. Also noticed note about, and implemented,
> module loading order.
> Everything seems straight as an arrow and no evil going ons detected so far.


But please note that this is really a bug in the nginx core, so what
I'm doing in ngx_lua's ngx.exec() (as well as ngx_echo's echo_exec) is
just a work-around. If you use other module to issue the jump to a
named location, bad things could still happen (or in your words, evil
stuffs). For example, ngx_upload's upload_pass directive or the core
module's post_action directive.

I've already posted a patch for the nginx core to the nginx-devel
mailing list, which fixes the issue completely:

That patch can also be applied cleanly to nginx 1.0.8 (at least).

BTW, this patch has already been incorporated into the ngx_openresty devel release:


More information about the nginx mailing list