Fetching contributors…
Cannot retrieve contributors at this time
43 lines (34 sloc) 1.06 KB
# Requires recent Haproxy to work with websockets (for example 1.4.16).
mode http
# Set timeouts to your needs
timeout client 5s
timeout connect 5s
timeout server 5s
frontend all
mode http
timeout client 120s
option forwardfor
# Fake connection:close, required in this setup.
option http-server-close
option http-pretend-keepalive
acl is_sockjs path_beg /echo /broadcast /close
acl is_stats path_beg /stats
use_backend sockjs if is_sockjs
use_backend stats if is_stats
default_backend static
backend sockjs
# Load-balance according to hash created from first two
# directories in url path. For example requests going to /1/
# should be handled by single server (assuming resource prefix is
# one-level deep, like "/echo").
balance uri depth 2
timeout server 120s
server srv_sockjs1
# server srv_sockjs2
backend static
balance roundrobin
server srv_static
backend stats
stats uri /stats
stats enable