Skip to content

Commit

Permalink
HAProxy - basic running config
Browse files Browse the repository at this point in the history
  • Loading branch information
mbailey committed Jul 11, 2011
1 parent c57a059 commit 0d63ae4
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions lib/deprec/templates/haproxy/haproxy.cfg.erb
Expand Up @@ -10,22 +10,40 @@ global
pidfile /var/run/haproxy.pid
daemon


defaults
option forwardfor
# Stats page at /haproxy?stats
stats enable
stats auth myuser:mypass
balance roundrobin
option httpclose
stats auth admin:secret

mode http
option forwardfor # Adds X-Forwarded-For header to http reqs
option httpclose # Needed for forwardfor
balance roundrobin
retries 3
option redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000

listen example_lb *:81

frontend web *:80

acl www hdr_beg(host) -i www

acl ip_local src 192.168.0.0/24

use_backend example_lb if www ip_local

default_backend localhost


backend example_lb
option httpchk HEAD /check.txt HTTP/1.0
server web1 127.0.0.1:80 weight 6 maxconn 12 check # cookie A
server web2 127.0.0.1:80 weight 10 maxconn 12 check # cookie B


backend localhost
server LOCALHOST 127.0.0.1:80

0 comments on commit 0d63ae4

Please sign in to comment.