Welcome! Log In Create A New Profile

Advanced

Re: Regarding using of nginx http load balancer

Roman Arutyunyan
August 05, 2014 07:56AM
On 05 Aug 2014, at 15:11, Pankaj Kaushik <dev.panky2014@gmail.com> wrote:

> Hey Roman,
>
> I do not actually get the idea how to use map in below scenario.
>
> Suppose i have two form of uri as mentioned below:-
>
> URI 1 : http://abc.10.23.32.22:2000/testFile
>
> URI 2 : http://10.20.32.23:2000/def/testFile
>
> So i want to fetch out following substring from above mentioned URI's as a key :-
>
> Key 1 : abc
>
> Key 2 : def
>

Here’s an example for the second case

map $uri $key2 {
~^(?<key>/[^/]+)/ $key;
default "";
}

Now you can use $key2 in the “hash” directive.

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

Regarding using of nginx http load balancer

Pankaj Kaushik 640 August 05, 2014 04:48AM

Re: Regarding using of nginx http load balancer

Piotr Sikora 261 August 05, 2014 04:52AM

Re: Regarding using of nginx http load balancer

Pankaj Kaushik 238 August 05, 2014 05:00AM

Re: Regarding using of nginx http load balancer

Roman Arutyunyan 260 August 05, 2014 05:38AM

Re: Regarding using of nginx http load balancer

Pankaj Kaushik 307 August 05, 2014 07:12AM

Re: Regarding using of nginx http load balancer

Roman Arutyunyan 423 August 05, 2014 07:56AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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