Skip to content

Instantly share code, notes, and snippets.

@sintaxi
Created January 22, 2014 20:58
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 sintaxi/8567225 to your computer and use it in GitHub Desktop.
Save sintaxi/8567225 to your computer and use it in GitHub Desktop.
global
maxconn 4096
pidfile /Users/sintaxi/Documents/Node/Modules/pids/haproxy.pid
defaults
mode http
retries 3
option redispatch
option httpclose
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
frontend HARP
bind *:80
# acl is_naked hdr_reg(host) -i /.+\.\w+\.\w+/
acl is_api hdr_beg(host) -i lvh.me
acl is_api method PUT
acl is_api method POST
use_backend API if is_api
default_backend KNOBS
backend KNOBS
balance roundrobin
server KNOB0 127.0.0.1:8001 check
#server KNOB1 127.0.0.1:8002 check
backend API
balance roundrobin
server API0 127.0.0.1:5001 check
#server API1 127.0.0.1:5002 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment