NGINX location regex

António P. P. Almeida appa at perusio.net
Thu Jul 14 17:41:54 MSD 2011


On 14 Jul 2011 14h27 WEST, pintux at crs4.it wrote:

> Hi,
>
> I'm trying to configure nginx to match a location conf for URLs like
> the following:
>
> http://myserver.com/consume?id=123
>
> but NOT the following:
>
> http://myserver.com/consumer/456

location = /consume {
  (...)
}

Note that arguments are not ever matched on locations. The reason
being that the order is arbitrary:

 /consume?id=123&t=234 is the same as /consume?t=234&id=123

> I've tried several regex but something in nginx is working different
> in respect to an external regex matcher...

From what you wrote above I see no need to use a regex based location.

--- appa




More information about the nginx mailing list