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.
7
# Create statistics counters this way :
10
# iptables -A OUTPUT -p tcp --syn --dport 80 -j http
11
# for i in $(seq 1 8); do iptables -A http -d 127.0.0.$i; done
12
# iptables -A http -d 127.0.0.0/24
14
# Consult the statistics using iptables this way:
16
# 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
26
stats socket /tmp/sock1 mode 600
41
server act1 127.0.0.1:80 weight 10 check port 81 inter 1000 fall 1
42
server act2 127.0.0.2:80 weight 20 check port 81 inter 1000 fall 1
43
server act3 127.0.0.3:80 weight 30 check port 81 inter 1000 fall 1
44
server act4 127.0.0.4:80 weight 40 check port 81 inter 1000 fall 1
45
server bck1 127.0.0.5:80 weight 10 check port 81 inter 1000 fall 1 backup
46
server bck2 127.0.0.6:80 weight 20 check port 81 inter 1000 fall 1 backup
47
server bck3 127.0.0.7:80 weight 30 check port 81 inter 1000 fall 1 backup
48
server bck4 127.0.0.8:80 weight 40 check port 81 inter 1000 fall 1 backup