Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (43 sloc) 1.41 KB
defaults
mode http
timeout connect 5s
timeout client 5s
timeout server 60s
frontend proxy
# listen on 80
bind 0.0.0.0:80
# allow for many connections, with long timeout
maxconn 200000 # total maximum connections, check ulimit as well
timeout client 24h
# default to webapp backend
default_backend webapp
# is this a socket io request?
acl is_websocket path_beg /socket.io
acl is_websocket hdr(Upgrade) -i WebSocket AND hdr_beg(Host) -i ws
use_backend websocket if is_websocket
backend webapp
balance roundrobin # assuming that you don't need stickiness
# allow client connections to linger for 5s
# but close server side requests to avoid keeping idle connections
option http-server-close
server ruby1 localhost:3000 check
backend websocket
balance source # balance based on source IP
# options
option forwardfor # add X-Forwarded-For
# Do not use httpclose (= client and server
# connections get closed), since it will close
# Websockets connections
no option httpclose
# Use "option http-server-close" to preserve
# client persistent connections while handling
# every incoming request individually, dispatching
# them one after another to servers, in HTTP close mode
option http-server-close
option forceclose
# timeouts are long
timeout queue 5s
timeout server 24h
timeout connect 24h
# just one node server at :8000
server node1 localhost:8000 check
Something went wrong with that request. Please try again.