nginx http-core enhancement: named location in subrequests + directive use_location

Maxim Dounin mdounin at
Thu Apr 30 18:56:55 UTC 2015


On Thu, Apr 30, 2015 at 07:13:01PM +0200, Sergey Brester wrote:

> Am 30.04.2015 15:55, schrieb Maxim Dounin: 
> > On Wed, Apr 29, 2015 at 07:22:51PM +0200, Sergey Brester 
> > wrote:
> > 
> > > And how it's expected to be processed in a named location if 
> > > r->uri is "@..."? Function 
> > > "ngx_http_core_find_named_location" if location was found 
> > > set "r->loc_conf = (*clcfp)->loc_conf" and returns NGX_OK.
> >
> > The problem is that the r->uri will be illegal.
> I think not for internal request?! 
> if (r->internal && r->uri... 

You think it's not a problem, or you think it won't be illegal?  

While it's not generally a problem for nginx if an URI in an 
internal request becomes illegal, it's certainly not a case we are 
going to promote by applying patches.  If illegal URIs are ok for 
you, you may just use something like

    auth_request @foo;

    location = @foo {

And it will work right now out of the box.

What you are trying to do is to misuse named locations as static 
locations with some invalid URIs.  This is wrong, named locations 
are different.  They preserve URI of a request untouched.  That's 
their main property and main advantage.

(BTW, please use plain text for further messages, I'm a bit bored 
to fix quoting in what your mail client produces as a plain text 
version.  Thank you.)

Maxim Dounin

More information about the nginx-devel mailing list