Skip to content

Instantly share code, notes, and snippets.

@vesse
Created October 24, 2013 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vesse/7134801 to your computer and use it in GitHub Desktop.
Save vesse/7134801 to your computer and use it in GitHub Desktop.
Basic HAProxy setup for nodejs app
global
daemon
maxconn 4096
user haproxy
group haproxy
defaults
log global
frontend http-in
mode http
bind *:80
timeout client 86400000
default_backend node_backend
acl is_websocket hdr(Upgrade) -i WebSocket
acl is_websocket hdr_beg(Host) -i ws
backend node_backend
mode http
option forwardfor
timeout server 86400000
timeout connect 5000
server mynodeservice localhost:3120 weight 1 maxconn 1024 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment