# Setting up proxy peers like HAproxy?

**URL:** <https://www.ruby-forum.com/t/setting-up-proxy-peers-like-haproxy/244503>\
**Category:** NGINX\
**Created:** [April 23, 2016, 2:23am UTC](https://www.ruby-forum.com/t/setting-up-proxy-peers-like-haproxy/244503 "2016-04-23T02:23:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [April 23, 2016, 2:23am UTC](https://www.ruby-forum.com/t/setting-up-proxy-peers-like-haproxy/244503/1 "2016-04-23T02:23:33Z")

</div>

With HAproxy, if you use multiple proxies you can synchronize their  
states:

[https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#3.5](https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#3.5)

This allows, for example, if you’re load balancing based on a header  
value, to make sure all clients sending the same header value will end  
up connecting to the same backend node.

Is something like this doable with Nginx?

–  
Florin Andrei  
[http://florin.myip.org/](http://florin.myip.org/)

---

<div class="post-metadata">

**Author:** ![Florin\_Andrei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@Florin\_Andrei](https://www.ruby-forum.com/u/Florin_Andrei)\
**Post date:** [April 23, 2016, 1:32pm UTC](https://www.ruby-forum.com/t/setting-up-proxy-peers-like-haproxy/244503/2 "2016-04-23T13:32:59Z")

</div>

Hello Florin,

i’m not sure how HAproxy works, but this sounds like sticky sessions.

[http://nginx.org/en/docs/http/ngx\_http\_upstream\_module.html#sticky](http://nginx.org/en/docs/http/ngx_http_upstream_module.html#sticky)

Kind regards

Alexander  
Am 23.04.2016 2:23 vorm. schrieb “Florin Andrei”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Florin\_Andrei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@Florin\_Andrei](https://www.ruby-forum.com/u/Florin_Andrei)\
**Post date:** [April 25, 2016, 10:32am UTC](https://www.ruby-forum.com/t/setting-up-proxy-peers-like-haproxy/244503/3 "2016-04-25T10:32:20Z")

</div>

Hi Florin Andrei.

Am 23-04-2016 02:22, schrieb Florin Andrei:

> With HAproxy, if you use multiple proxies you can synchronize their  
> states:
> 
> [HAProxy version 1.5.18 - Configuration Manual](https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#3.5)
> 
> This allows, for example, if you’re load balancing based on a header  
> value, to make sure all clients sending the same header value will end  
> up connecting to the same backend node.
> 
> Is something like this doable with Nginx?

As far a I know nginx nor n+ have a similar option.

I think the most closest solution is something like a combination with  
set & memcache.

> **[Module ngx\_http\_map\_module](http://nginx.org/en/docs/http/ngx_http_map_module.html)**

> **[Module ngx\_http\_memcached\_module](http://nginx.org/en/docs/http/ngx_http_memcached_module.html)**

Just try this search [https://startpage.com/do/search?q=nginx+memcached](https://startpage.com/do/search?q=nginx+memcached)

Best regards  
Aleks
