Welcome! Log In Create A New Profile

Advanced

Re: Matching multiple endpoints in location of nginx.conf

November 24, 2014 01:14AM
On 23 Nov 2014, at 23:51, keeyong <nginx-forum@nginx.us> wrote:

> I can't really test this easily so I am asking instead. I have this location
> statement in my nginx.conf:
>
> location ~* ^/(api/abcd)/ {
> ...
> }
>
> Now I want to match against "api/efgh". Then the regex should be something
> like this?
>
> location ~* ^/(api/(abcd|efgh))/ {
> ...
> }
>
> OR
>
> location ~* ^/api/(abcd|efgh)/ {
> ...
> }
>
> OR
>
> something else?

location /api/abcd/ {
[ some configuration ]
}

location /api/efgh/ {
[ and yes, copy paste the configuration above ]
}


--
Igor Sysoev
http://nginx.com

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

Matching multiple endpoints in location of nginx.conf

keeyong November 23, 2014 03:51PM

Re: Matching multiple endpoints in location of nginx.conf

Igor Sysoev November 24, 2014 01:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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