Welcome! Log In Create A New Profile

Advanced

Re: merge two location site to 1 location

January 07, 2011 09:22AM
On Fri, Jan 7, 2011 at 9:00 PM, kevinew <nginx-forum@nginx.us> wrote:
> Now i'll write two sections of location as follow:
> location =/aaa{}
> location =/BBB{}
> But I want to write the two sections to one location?    eg. location
> =/[aaa,BBB]{}  , but it's wrong, and does someone know how to write it?
> Thanks in advance.
>

if you want it to contain same thing, just create another file and
include that file:

location = /aaa {
include blah;
}
location = /bbb {
include blah;
}

alternatively someone may have made a tool to batch such job.

Or the slow (and therefore not recommended) way:

location ~ ^/(aaa|bbb)$ {
...
}


I had the idea to create a glob-like syntax which expands the
expression automatically upon loading config but as I don't have
enough C skill and apparently there's already tool for that (and
deemed sufficient), it's never got implemented.

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

merge two location site to 1 location

kevinew January 07, 2011 09:00AM

Re: merge two location site to 1 location

António P. P. Almeida January 07, 2011 09:18AM

Re: merge two location site to 1 location

António P. P. Almeida January 07, 2011 09:40AM

Re: merge two location site to 1 location

kevinew January 07, 2011 12:06PM

Re: merge two location site to 1 location

edogawaconan January 07, 2011 09:22AM

Re: merge two location site to 1 location

kevinew January 07, 2011 12:12PM

Re: merge two location site to 1 location

Maxim Dounin January 07, 2011 12:38PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 270
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