So is "rewrite_by_lua" also evil?

agentzh agentzh at gmail.com
Sat Oct 15 10:33:38 UTC 2011


On Sat, Oct 15, 2011 at 6:16 PM, Eugaia <ngx.eugaia at gmail.com> wrote:
> On 15/10/2011 12:40, agentzh wrote:
>>
>> Okay, I must say that ngx_rewrite's "last" won't affect rewrite_by_lua
>> because rewrite_by_lua is not part of that module (and there's no
>> known way to achieve that).
>
> You could achieve that now by creating a dummy variable, and instead of
> using a new handler for the rewrite by code, you wrap the code around the
> setby lua code.  It would waste a few cycles, since it would be setting a
> variable unnecessarily, but would have the benefit of not slowing down the
> execution of code that didn't use rewrite_by, since it wouldn't be adding an
> extra handler to process for all the other requests.
>

I do not fully grok your approach but I'd ask first: will this
approach allow subrequests, internal redirection, non-blocking sleep,
and all the other fancy stuffs?

Regards,
-agentzh



More information about the nginx mailing list