willy tarreau | 982249e | 2005-12-18 00:57:06 +0100 | [diff] [blame] | 1 | # this config needs haproxy-1.1.28 or haproxy-1.2.1 |
willy tarreau | 197e8ec | 2005-12-17 14:10:59 +0100 | [diff] [blame] | 2 | |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 3 | global |
| 4 | log 127.0.0.1 local0 |
willy tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 5 | log 127.0.0.1 local1 notice |
| 6 | #log loghost local0 info |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 7 | maxconn 4096 |
willy tarreau | 982249e | 2005-12-18 00:57:06 +0100 | [diff] [blame] | 8 | chroot /usr/share/haproxy |
| 9 | uid 99 |
| 10 | gid 99 |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 11 | daemon |
| 12 | #debug |
| 13 | #quiet |
| 14 | |
willy tarreau | 197e8ec | 2005-12-17 14:10:59 +0100 | [diff] [blame] | 15 | defaults |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 16 | log global |
| 17 | mode http |
| 18 | option httplog |
| 19 | option dontlognull |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 20 | retries 3 |
| 21 | redispatch |
| 22 | maxconn 2000 |
| 23 | contimeout 5000 |
| 24 | clitimeout 50000 |
| 25 | srvtimeout 50000 |
willy tarreau | 197e8ec | 2005-12-17 14:10:59 +0100 | [diff] [blame] | 26 | |
| 27 | listen 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 tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 35 | listen appli2-insert 0.0.0.0:10002 |
willy tarreau | bc4e1fb | 2005-12-17 13:32:07 +0100 | [diff] [blame] | 36 | option httpchk |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 37 | 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 tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 41 | capture cookie vgnvisitor= len 32 |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 42 | |
willy tarreau | 982249e | 2005-12-18 00:57:06 +0100 | [diff] [blame] | 43 | option httpclose # disable keep-alive |
willy tarreau | 750a472 | 2005-12-17 13:21:24 +0100 | [diff] [blame] | 44 | rspidel ^Set-cookie:\ IP= # do not let this cookie tell our internal IP address |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 45 | |
| 46 | listen appli3-relais 0.0.0.0:10003 |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 47 | dispatch 192.168.135.17:80 |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 48 | |
willy tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 49 | listen appli4-backup 0.0.0.0:10004 |
willy tarreau | 2f6ba65 | 2005-12-17 13:57:42 +0100 | [diff] [blame] | 50 | option httpchk /index.html |
willy tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 51 | 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 tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 55 | |
| 56 | listen appli5-backup 0.0.0.0:10005 |
willy tarreau | 2f6ba65 | 2005-12-17 13:57:42 +0100 | [diff] [blame] | 57 | option httpchk * |
willy tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 58 | balance roundrobin |
| 59 | cookie SERVERID insert indirect nocache |
| 60 | server inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3 |
| 61 | server inst2 192.168.114.56:81 cookie server02 check inter 2000 fall 3 |
| 62 | server inst3 192.168.114.57:80 backup check inter 2000 fall 3 |
| 63 | capture cookie ASPSESSION len 32 |
willy tarreau | 197e8ec | 2005-12-17 14:10:59 +0100 | [diff] [blame] | 64 | srvtimeout 20000 |
willy tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 65 | |
willy tarreau | 982249e | 2005-12-18 00:57:06 +0100 | [diff] [blame] | 66 | option httpclose # disable keep-alive |
| 67 | option checkcache # block response if set-cookie & cacheable |
| 68 | |
willy tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 69 | rspidel ^Set-cookie:\ IP= # do not let this cookie tell our internal IP address |
| 70 | |
| 71 | errorloc 502 http://192.168.114.58/error502.html |
| 72 | |