# Load balancer (haproxy) option http-keep-alive problem

**URL:** <https://forums.suse.com/t/load-balancer-haproxy-option-http-keep-alive-problem/7612>\
**Category:** General\
**Created:** [October 18, 2017, 9:47am UTC](https://forums.suse.com/t/load-balancer-haproxy-option-http-keep-alive-problem/7612 "2017-10-18T09:47:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joel\_MARTIN](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Joel\_MARTIN](https://forums.suse.com/u/Joel_MARTIN)\
**Post date:** [October 18, 2017, 9:47am UTC](https://forums.suse.com/t/load-balancer-haproxy-option-http-keep-alive-problem/7612/1 "2017-10-18T09:47:10Z")

</div>

Hello,  
I’m on Rancher/server 1.6.8 and I’m trying to add custom options on haproxy.cfg for the load-balancer.  
I want to replace : `option http-server-close` by `option http-keep-alive`  
But when I add `option http-keep-alive` to the RANCHER web GUI in the section “custom haproxy.cfg” the result on the haproxy container is :  
defaults  
errorfile 400 /etc/haproxy/errors/400.http  
errorfile 403 /etc/haproxy/errors/403.http  
errorfile 408 /etc/haproxy/errors/408.http  
errorfile 500 /etc/haproxy/errors/500.http  
errorfile 502 /etc/haproxy/errors/502.http  
errorfile 503 /etc/haproxy/errors/503.http  
errorfile 504 /etc/haproxy/errors/504.http  
maxconn 4096  
mode tcp  
option forwardfor  
**option http-server-close**  
option redispatch  
retries 3  
timeout client 50000  
timeout connect 5000  
timeout server 50000  
**option http-keep-alive**

Is there a solution to replace this option and not just append it to the end of the default haproxy.cfg ?  
Thanks to you 🙂

---

<div class="post-metadata">

**Author:** ![Joel\_MARTIN](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Joel\_MARTIN](https://forums.suse.com/u/Joel_MARTIN)\
**Post date:** [October 23, 2017, 12:36pm UTC](https://forums.suse.com/t/load-balancer-haproxy-option-http-keep-alive-problem/7612/2 "2017-10-23T12:36:31Z")

</div>

up 🤔  
Nobody have a solution for that ?

---

<div class="post-metadata">

**Author:** ![247687009](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/247687009/32/3023_2.png) [@247687009](https://forums.suse.com/u/247687009)\
**Post date:** [October 26, 2017, 9:01am UTC](https://forums.suse.com/t/load-balancer-haproxy-option-http-keep-alive-problem/7612/3 "2017-10-26T09:01:00Z")

</div>

Hi  
I used config support keepalive

option http-pretend-keepalive  
option srvtcpka  
option clitcpka  
option forwardfor  
option http-keep-alive

---

<div class="post-metadata">

**Author:** ![Joel\_MARTIN](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Joel\_MARTIN](https://forums.suse.com/u/Joel_MARTIN)\
**Post date:** [October 26, 2017, 2:16pm UTC](https://forums.suse.com/t/load-balancer-haproxy-option-http-keep-alive-problem/7612/4 "2017-10-26T14:16:05Z")

</div>

Thank you 247687009 !  
I’will look at this as soon as possible & come back to you 🙂

---

<div class="post-metadata">

**Author:** ![Joel\_MARTIN](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Joel\_MARTIN](https://forums.suse.com/u/Joel_MARTIN)\
**Post date:** [October 27, 2017, 8:27am UTC](https://forums.suse.com/t/load-balancer-haproxy-option-http-keep-alive-problem/7612/5 "2017-10-27T08:27:05Z")

</div>

Ok, I just tried to add this lines in the custum haproxy.cfg section, but the result is the same, It just append the lines but not replace the lines as it should.

---

<div class="post-metadata">

**Author:** ![knick\_burns](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@knick\_burns](https://forums.suse.com/u/knick_burns)\
**Post date:** [November 29, 2017, 9:30pm UTC](https://forums.suse.com/t/load-balancer-haproxy-option-http-keep-alive-problem/7612/6 "2017-11-29T21:30:05Z")

</div>

I have this issue as well. The only way it appears to ensure my Connection: keep-alive header is sent back to the browser is if I use TCP mode instead of HTTP
