Welcome! Log In Create A New Profile

Advanced

Re: So is "rewrite_by_lua" also evil?

agentzh
October 13, 2011 12:56AM
On Thu, Oct 13, 2011 at 12:32 PM, Nginx User <nginx@nginxuser.net> wrote:
> On 13 October 2011 05:06, agentzh <agentzh@gmail.com> wrote:
>> Basically, calling ngx.exec to jump to a named location is buggy in
>> that ngx_http_named_location() in the nginx core does not clear module
>> ctx structures as ngx_http_internal_redirect() so ngx_lua should have
>> cleared its ctx itself.
> I see. Don't know much about this but does this mean the httpRewrite
> module does clear this ctx? I.E. why doesn't this affect the standard
> rewrite module?

For ngx_lua, for example, it does have a flag field named
"entered_content_phase" in its context object (ctx) which marks
whether the current request has entered the content phase. So when
doing an internal redirection to a named location, this field must be
cleared out or some bad things will happen in rewrite_by_lua because
ngx_lua now believes it's in a content_by_lua not rewrite_by_lua.

Well, there're more flags like this in ngx_lua ctx. For ngx_rewrite,
it's probably safe just because of its simplicity.

Well, I still believe it is a bug in ngx_http_named_location function
in the nginx core. The thumb of rule is to avoid using named locations
like @proxy but use normal locations configured with the "internal"
directive. And we've been keeping doing this in our production apps.

Regards,
-agentzh

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

So is "rewrite_by_lua" also evil?

Nginx User October 11, 2011 12:04PM

Re: So is "rewrite_by_lua" also evil?

agentzh October 11, 2011 08:18PM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 12, 2011 12:14AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 12, 2011 12:22AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 12, 2011 12:50AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 12, 2011 02:38PM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 12, 2011 05:36PM

Re: So is "rewrite_by_lua" also evil?

agentzh October 12, 2011 10:08PM

Re: So is "rewrite_by_lua" also evil?

agentzh October 12, 2011 11:58PM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 13, 2011 12:36AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 13, 2011 12:34AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 13, 2011 12:56AM

Re: So is "rewrite_by_lua" also evil?

Eugaia October 14, 2011 07:02AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 14, 2011 07:42AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 12, 2011 09:36PM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 13, 2011 12:32AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 13, 2011 12:54AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 13, 2011 02:02AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 13, 2011 12:12PM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 13, 2011 08:18PM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 14, 2011 09:28AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 14, 2011 03:26PM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 14, 2011 03:26PM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 14, 2011 04:42PM

Re: So is "rewrite_by_lua" also evil?

agentzh October 15, 2011 02:38AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 15, 2011 04:48AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 15, 2011 05:42AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 15, 2011 05:58AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 15, 2011 06:08AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 15, 2011 07:38AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 15, 2011 09:24AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 15, 2011 10:22AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 16, 2011 12:30AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 16, 2011 07:12AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 16, 2011 11:44AM

Re: So is "rewrite_by_lua" also evil?

Eugaia October 15, 2011 06:26AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 15, 2011 07:08AM

Re: So is "rewrite_by_lua" also evil?

Eugaia October 15, 2011 06:18AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 15, 2011 06:34AM

Re: So is "rewrite_by_lua" also evil?

Eugaia October 15, 2011 06:46AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 15, 2011 07:10AM

Re: So is "rewrite_by_lua" also evil?

Eugaia October 15, 2011 07:40AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 16, 2011 12:18AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 14, 2011 09:28PM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 15, 2011 04:34AM

Re: So is "rewrite_by_lua" also evil?

agentzh October 13, 2011 08:38PM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 14, 2011 04:32AM

Re: So is "rewrite_by_lua" also evil?

MyName October 12, 2011 06:23AM

Re: So is "rewrite_by_lua" also evil?

Nginx User October 12, 2011 06:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 255
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready