blob: 1add7ff3409675e09b50544e4ef96a6853ee4369 [file] [log] [blame]
willy tarreau982249e2005-12-18 00:57:06 +01001# this config needs haproxy-1.1.28 or haproxy-1.2.1
willy tarreau197e8ec2005-12-17 14:10:59 +01002
willy tarreau240afa62005-12-17 13:14:35 +01003global
4 log 127.0.0.1 local0
willy tarreau8337c6b2005-12-17 13:41:01 +01005 log 127.0.0.1 local1 notice
6 #log loghost local0 info
willy tarreau240afa62005-12-17 13:14:35 +01007 maxconn 4096
willy tarreau982249e2005-12-18 00:57:06 +01008 chroot /usr/share/haproxy
9 uid 99
10 gid 99
willy tarreau240afa62005-12-17 13:14:35 +010011 daemon
12 #debug
13 #quiet
14
willy tarreau197e8ec2005-12-17 14:10:59 +010015defaults
willy tarreau240afa62005-12-17 13:14:35 +010016 log global
17 mode http
18 option httplog
19 option dontlognull
willy tarreau240afa62005-12-17 13:14:35 +010020 retries 3
21 redispatch
22 maxconn 2000
23 contimeout 5000
24 clitimeout 50000
25 srvtimeout 50000
willy tarreau197e8ec2005-12-17 14:10:59 +010026
27listen appli1-rewrite 0.0.0.0:10001
28 cookie SERVERID rewrite
29 balance roundrobin
30 server app1_1 192.168.34.23:8080 cookie app1inst1 check inter 2000 rise 2 fall 5
31 server app1_2 192.168.34.32:8080 cookie app1inst2 check inter 2000 rise 2 fall 5
32 server app1_3 192.168.34.27:8080 cookie app1inst3 check inter 2000 rise 2 fall 5
33 server app1_4 192.168.34.42:8080 cookie app1inst4 check inter 2000 rise 2 fall 5
34
willy tarreau240afa62005-12-17 13:14:35 +010035listen appli2-insert 0.0.0.0:10002
willy tarreaubc4e1fb2005-12-17 13:32:07 +010036 option httpchk
willy tarreau240afa62005-12-17 13:14:35 +010037 balance roundrobin
38 cookie SERVERID insert indirect nocache
39 server inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3
40 server inst2 192.168.114.56:81 cookie server02 check inter 2000 fall 3
willy tarreau8337c6b2005-12-17 13:41:01 +010041 capture cookie vgnvisitor= len 32
willy tarreau240afa62005-12-17 13:14:35 +010042
willy tarreau982249e2005-12-18 00:57:06 +010043 option httpclose # disable keep-alive
willy tarreau750a4722005-12-17 13:21:24 +010044 rspidel ^Set-cookie:\ IP= # do not let this cookie tell our internal IP address
willy tarreau240afa62005-12-17 13:14:35 +010045
46listen appli3-relais 0.0.0.0:10003
willy tarreau240afa62005-12-17 13:14:35 +010047 dispatch 192.168.135.17:80
willy tarreau240afa62005-12-17 13:14:35 +010048
willy tarreau8337c6b2005-12-17 13:41:01 +010049listen appli4-backup 0.0.0.0:10004
willy tarreau2f6ba652005-12-17 13:57:42 +010050 option httpchk /index.html
willy tarreau8337c6b2005-12-17 13:41:01 +010051 option persist
52 balance roundrobin
53 server inst1 192.168.114.56:80 check inter 2000 fall 3
54 server inst2 192.168.114.56:81 check inter 2000 fall 3 backup
willy tarreau8337c6b2005-12-17 13:41:01 +010055
Willy Tarreauf3c69202006-07-09 16:42:34 +020056listen ssl-relay 0.0.0.0:8443
57 option ssl-hello-chk
58 balance source
59 server inst1 192.168.110.56:443 check inter 2000 fall 3
60 server inst2 192.168.110.57:443 check inter 2000 fall 3
61 server back1 192.168.120.58:443 backup
62
willy tarreau8337c6b2005-12-17 13:41:01 +010063listen appli5-backup 0.0.0.0:10005
willy tarreau2f6ba652005-12-17 13:57:42 +010064 option httpchk *
willy tarreau8337c6b2005-12-17 13:41:01 +010065 balance roundrobin
66 cookie SERVERID insert indirect nocache
67 server inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3
68 server inst2 192.168.114.56:81 cookie server02 check inter 2000 fall 3
69 server inst3 192.168.114.57:80 backup check inter 2000 fall 3
70 capture cookie ASPSESSION len 32
willy tarreau197e8ec2005-12-17 14:10:59 +010071 srvtimeout 20000
willy tarreau8337c6b2005-12-17 13:41:01 +010072
willy tarreau982249e2005-12-18 00:57:06 +010073 option httpclose # disable keep-alive
74 option checkcache # block response if set-cookie & cacheable
75
willy tarreau8337c6b2005-12-17 13:41:01 +010076 rspidel ^Set-cookie:\ IP= # do not let this cookie tell our internal IP address
77
78 errorloc 502 http://192.168.114.58/error502.html
79