NGINX location regex

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

I’ve tried several regex but something in nginx is working different in
respect to an external regex matcher…

Can you help me , please?

Thanks,

Antonio

Antonio Pintus

Technologist
ICT group
CRS4, Center for Advanced Studies, Research and Development in Sardinia

e-mail: [email protected]
Phone: +39 0709250268
Skype: pintuxskype

CRS4 Home: http://www.crs4.it

On 14 Jul 2011 14h27 WEST, [email protected] 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

Thanks Antonio,

it works.

Best,

Antonio

Il 14/07/11 15.41, Antnio P. P. Almeida ha scritto:

[email protected]
nginx Info Page

Antonio Pintus

Technologist
ICT group
CRS4, Center for Advanced Studies, Research and Development in Sardinia

e-mail: [email protected]
Phone: +39 0709250268
Skype: pintuxskype

CRS4 Home: http://www.crs4.it