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

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 :
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 :slight_smile:

up :thinking:
Nobody have a solution for that ?

I used config support keepalive

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

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

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.

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