I'm using Haproxy with tornado for websocket. My connection working fine if i directly connect to tornado but if i use HAproxy with below config then connection closed after 50 seconds. My Haproxy config file is below.
global
daemon
maxconn 4032
pidfile /var/run/haproxy.pid
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
option http-server-close
maxconn 4032
frontend http-in
bind *:80
acl is_websocket hdr_end(host) -i WebSocket
use_backend servers if is_websocket
default_backend servers
option redispatch
option http-server-close
maxconn 2000
contimeout 500000
clitimeout 500000
srvtimeout 500000
contimeout 500000
timeout contimeout 500000
timeout connect 500000
backend servers
server server1 127.0.0.1:8886 maxconn 4032
Now by using above config my websocket connection automatically lost after 50 seconds. I want to do persistent connection so is there is any way to make connection persistent in HAproxy ?