1
# This is a test configuration.
2
# It makes use of a farm built from 4 active servers and 4 backup servers,
3
# all listenening to different IP addresses on port 80. Health-checks are
4
# TCP only on port 81 so that iptables rules permit easy selection of which
5
# servers are enabled or disabled. It checks for the file /alive, and disables
6
# the server if the response is 404.
8
# Create statistics counters this way :
11
# iptables -A OUTPUT -p tcp --syn --dport 80 -j http
12
# for i in $(seq 1 8); do iptables -A http -d 127.0.0.$i; done
13
# iptables -A http -d 127.0.0.0/24
15
# Consult the statistics using iptables this way:
17
# iptables --line-numbers -nxvL http
20
# Block individual servers like this :
21
# iptables -I INPUT -p tcp --dport 81 -d 127.0.0.1 -j DROP
23
# Enable each server like this :
24
# touch $SRV_ROOT/alive
26
# Disable each server like this :
27
# rm -f $SRV_ROOT/alive
32
stats socket /tmp/sock1 mode 600
45
cookie SRV insert indirect nocache
49
server act1 127.0.0.1:80 cookie a1 weight 10 check port 81 inter 1000 fall 4
50
server act2 127.0.0.2:80 cookie a2 weight 20 check port 81 inter 1000 fall 4
51
server act3 127.0.0.3:80 cookie a3 weight 30 check port 81 inter 1000 fall 4
52
server act4 127.0.0.4:80 cookie a4 weight 40 check port 81 inter 1000 fall 4
53
server bck1 127.0.0.5:80 cookie b1 weight 10 check port 81 inter 1000 fall 4 backup
54
server bck2 127.0.0.6:80 cookie b2 weight 20 check port 81 inter 1000 fall 4 backup
55
server bck3 127.0.0.7:80 cookie b3 weight 30 check port 81 inter 1000 fall 4 backup
56
server bck4 127.0.0.8:80 cookie b4 weight 40 check port 81 inter 1000 fall 4 backup
60
option httpchk GET /alive
61
http-check disable-on-404