Skip to content

Instantly share code, notes, and snippets.

@taka-wang
Last active August 29, 2015 14:00
Show Gist options
  • Save taka-wang/11106308 to your computer and use it in GitHub Desktop.
Save taka-wang/11106308 to your computer and use it in GitHub Desktop.
haproxy load balancer for node.js application
global
log 127.0.0.1 local0 notice
maxconn 2000
user haproxy
group haproxy
defaults
log global
mode http
option dontlognull
retries 3
option redispatch
timeout connect 5000
timeout client 10000
timeout server 10000
listen app_name 0.0.0.0:9000
mode http
stats enable
stats uri /haproxy?stats
stats realm Strictly\ Private
stats auth user:password
balance roundrobin
option httpclose
option forwardfor
server node1 0.0.0.0:9001 check
server node2 0.0.0.0:9002 check
listen _tcp :9009
mode tcp
balance leastconn
timeout server 3600000
server tcp_server 0.0.0.0:80 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment