willy tarreau | 197e8ec | 2005-12-17 14:10:59 +0100 | [diff] [blame] | 1 | # this config needs haproxy-1.1.23 |
| 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 |
| 8 | chroot /tmp |
| 9 | uid 11 |
| 10 | gid 2 |
| 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 | 750a472 | 2005-12-17 13:21:24 +0100 | [diff] [blame] | 43 | reqidel ^Connection: # disable keep-alive |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 44 | reqadd Connection:\ close |
| 45 | rspidel ^Connection: |
| 46 | rspadd Connection:\ close |
willy tarreau | 750a472 | 2005-12-17 13:21:24 +0100 | [diff] [blame] | 47 | 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] | 48 | |
| 49 | listen appli3-relais 0.0.0.0:10003 |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 50 | dispatch 192.168.135.17:80 |
willy tarreau | 240afa6 | 2005-12-17 13:14:35 +0100 | [diff] [blame] | 51 | |
willy tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 52 | listen appli4-backup 0.0.0.0:10004 |
willy tarreau | 2f6ba65 | 2005-12-17 13:57:42 +0100 | [diff] [blame] | 53 | option httpchk /index.html |
willy tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 54 | option persist |
| 55 | balance roundrobin |
| 56 | server inst1 192.168.114.56:80 check inter 2000 fall 3 |
| 57 | 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] | 58 | |
| 59 | listen appli5-backup 0.0.0.0:10005 |
willy tarreau | 2f6ba65 | 2005-12-17 13:57:42 +0100 | [diff] [blame] | 60 | option httpchk * |
willy tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 61 | balance roundrobin |
| 62 | cookie SERVERID insert indirect nocache |
| 63 | server inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3 |
| 64 | server inst2 192.168.114.56:81 cookie server02 check inter 2000 fall 3 |
| 65 | server inst3 192.168.114.57:80 backup check inter 2000 fall 3 |
| 66 | capture cookie ASPSESSION len 32 |
willy tarreau | 197e8ec | 2005-12-17 14:10:59 +0100 | [diff] [blame] | 67 | srvtimeout 20000 |
willy tarreau | 8337c6b | 2005-12-17 13:41:01 +0100 | [diff] [blame] | 68 | |
| 69 | reqidel ^Connection: # disable keep-alive |
| 70 | reqadd Connection:\ close |
| 71 | rspidel ^Connection: |
| 72 | rspadd Connection:\ close |
| 73 | rspidel ^Set-cookie:\ IP= # do not let this cookie tell our internal IP address |
| 74 | |
| 75 | errorloc 502 http://192.168.114.58/error502.html |
| 76 | |