Regarding using of nginx http load balancer
Roman Arutyunyan
arut at nginx.com
Tue Aug 5 09:37:33 UTC 2014
On 05 Aug 2014, at 12:58, Pankaj Kaushik <dev.panky2014 at gmail.com> wrote:
> Hey Piotr,
>
>
>
> On Tue, Aug 5, 2014 at 2:21 PM, Piotr Sikora <piotr at cloudflare.com> wrote:
>
> What's wrong with "hash" [1]?
>
> [1] http://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash
>
>
>
> As mentioned in the syntax at above link:-
>
> Syntax: hash key [consistent];
> Default: —
> Context: upstream
>
>
> In my scenario i have to fetch key out of uri and then need to hash that to identify the backend server.
>
> Basically i need to fetch the key out of uri during run time.
>
> Can you please help in knowing how can i do that?
>
You can use $arg_XXX variables to access arguments passed in uri.
Or you can use “map" directive to fetch any part of $uri directly
http://nginx.org/ru/docs/http/ngx_http_map_module.html
> Thanks,
> Panky
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
More information about the nginx-devel
mailing list