blob: 4368294eb8270bf62ec274afcfedff8cfeb90948 [file] [log] [blame]
Willy Tarreau51406232008-03-10 22:04:20 +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 tcp
32 retries 1
Willy Tarreaud4359fd2021-04-02 10:49:34 +020033 option redispatch
34 timeout connect 1000
35 timeout client 120000
36 timeout server 120000
Willy Tarreau51406232008-03-10 22:04:20 +010037 maxconn 40000
38 bind :8080
39 balance leastconn
40 option allbackups
41 server act1 127.0.0.1:80 weight 10 maxconn 200 check inter 1000 fall 1
42 server act2 127.0.0.2:80 weight 20 maxconn 200 check inter 1000 fall 1
43 server act3 127.0.0.3:80 weight 30 maxconn 200 check inter 1000 fall 1
44 server act4 127.0.0.4:80 weight 40 maxconn 200 check inter 1000 fall 1
45 server bck1 127.0.0.5:80 weight 10 check inter 1000 fall 1 backup
46 server bck2 127.0.0.6:80 weight 20 check inter 1000 fall 1 backup
47 server bck3 127.0.0.7:80 weight 30 check inter 1000 fall 1 backup
48 server bck4 127.0.0.8:80 weight 40 check inter 1000 fall 1 backup
49 option httpclose
50
Willy Tarreaud4359fd2021-04-02 10:49:34 +020051listen sample2
Willy Tarreau51406232008-03-10 22:04:20 +010052 mode http
Willy Tarreaud4359fd2021-04-02 10:49:34 +020053 timeout connect 1000
54 timeout client 50000
55 timeout server 50000
Willy Tarreau51406232008-03-10 22:04:20 +010056 maxconn 40000
57 bind :8081
58 balance leastconn
59 option httpclose
60 stats uri /stats
61 stats refresh 5