blob: ed283ca277272f4cfcd73a61e386e8b40b4234cc [file] [log] [blame]
Willy Tarreau980b7d32007-11-26 01:25:18 +01001# 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.
6#
7# Create statistics counters this way :
8#
9# iptables -N http
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
13#
14# Consult the statistics using iptables this way:
15#
16# iptables --line-numbers -nxvL http
17# iptables -Z http
18#
19#
20# Block individual servers like this :
21# iptables -I INPUT -p tcp --dport 81 -d 127.0.0.1 -j DROP
22#
23
24global
25 maxconn 1000
26 stats socket /tmp/sock1 mode 600
27 stats timeout 3000
28 stats maxconn 2000
29
30listen sample1
31 mode http
32 retries 1
Willy Tarreaud4359fd2021-04-02 10:49:34 +020033 option redispatch
34 timeout connect 1000
35 timeout client 5000
36 timeout server 5000
Willy Tarreau980b7d32007-11-26 01:25:18 +010037 maxconn 40000
38 bind :8080
39 balance roundrobin
40 option allbackups
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
49 option httpclose
50 stats uri /stats
51 stats refresh 5