Created
June 7, 2011 05:27
-
-
Save sidupadhyay/1011730 to your computer and use it in GitHub Desktop.
Sample HA Proxy Config for Tornado/Socket.io Backends
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
maxconn 10000 # Total Max Connections. This is dependent on ulimit | |
nbproc 2 | |
defaults | |
mode http | |
option redispatch | |
maxconn 2000 | |
contimeout 5000 | |
clitimeout 50000 | |
srvtimeout 50000 | |
option httpclose | |
frontend all 0.0.0.0:80 | |
timeout client 86400000 | |
acl is_websocket hdr(Upgrade) -i WebSocket | |
acl is_websocket hdr_beg(Host) -i ws | |
use_backend socket_backend if is_websocket # Filter for Websockets | |
default_backend www_backend | |
backend www_backend | |
balance roundrobin | |
cookie SERVERID insert indirect # Match requests to same machines, if possible | |
option forwardfor # This sets X-Forwarded-For | |
timeout server 30000 | |
timeout connect 4000 | |
server server1 localhost:8001 weight 1 maxconn 5000 cookie FE1 check | |
server server2 localhost:8002 weight 1 maxconn 5000 cookie FE2 check | |
backend socket_backend | |
balance roundrobin | |
cookie SOCKETID insert indirect # Match socket requests to same machines, if possible | |
option forwardfor # This sets X-Forwarded-For | |
no option httpclose # To match the `Connection` header for the websocket protocol rev. 76 | |
option http-server-close | |
option http-pretend-keepalive | |
timeout queue 5000 | |
timeout server 86400000 | |
timeout connect 86400000 | |
server server1 localhost:8001 weight 1 maxconn 5000 cookie SCKT1 check | |
server server2 localhost:8002 weight 1 maxconn 5000 cookie SCKT2 check |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment