Welcome! Log In Create A New Profile

Advanced

Re: Proxy pass location inheritance

Francis Daly
February 17, 2014 04:18AM
On Mon, Feb 17, 2014 at 08:55:02AM +0000, Brian Hill wrote:

Hi there,

> Regex 1 & 3 look for the same file types and are identical, but contain different configurations based on the parent location. Currently, regex1 is catching all matches, irrespective of the parent location.
>
> If I understand correctly, I could solve my problem by moving the regex2 location block before the / location block, and then rewriting regex3 so that it included the elements of both the current regex2 and regex3. That way, regex3 would ONLY hit for items that matched both the current regex2 and regex3, and it would appear before regex1 in the order of execution.
>
> Is this correct, or will NGINX always give priority to the / location?

Replace the directives inside the regex1 and regex3 locations with things
like

return 200 "Inside regex1\n";

and you should be able to test it straightforwardly enough.

Alternatively, the mail you are replying to includes the words

"""
Locations given by
regular expressions within a matching prefix location are tested
before other locations given by regular expressions.
"""

If that's not clear, or if you want to test whether it matches what you
observe, a similar "return" configuration should work too.

(I'd say that your suggestion won't work as you want it to, because "/" is
still the best-match prefix location, and therefore regex matches within
"/" will be tested before regex matches outside of that location. You'll
be happier if you limit yourself to prefix matches at server level.)

Good luck with it,

f
--
Francis Daly francis@daoine.org

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

Proxy pass location inheritance

brih February 13, 2014 01:44PM

Re: Proxy pass location inheritance

Maxim Dounin February 14, 2014 07:22AM

RE: Proxy pass location inheritance

brih February 17, 2014 03:56AM

Re: Proxy pass location inheritance

Francis Daly February 17, 2014 04:18AM

Re: Proxy pass location inheritance

Maxim Dounin February 17, 2014 08:14AM

RE: Proxy pass location inheritance

brih February 17, 2014 12:16PM

Re: Proxy pass location inheritance

Maxim Dounin February 17, 2014 12:32PM

RE: Proxy pass location inheritance

brih February 17, 2014 04:28PM

Re: Proxy pass location inheritance

Maxim Dounin February 18, 2014 07:14AM

RE: Proxy pass location inheritance

brih February 18, 2014 01:18PM

Re: Proxy pass location inheritance

Igor Sysoev February 19, 2014 02:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 325
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready