README
[demos/kafka/chat] / haproxy.cfg
1 # Config from Blog-article "How to Run HAProxy with Docker"
2 defaults
3   mode http
4   timeout client 10s
5   timeout connect 5s
6   timeout server 10m
7   timeout http-request 10s
8   log global
9
10 global
11   stats socket ipv4@:8401 level admin
12   stats timeout 2m
13
14 frontend stats
15   bind *:8404
16   stats enable
17   stats uri /
18   stats refresh 10s
19
20 frontend frontend
21   bind :8400
22   default_backend random
23   use_backend %[req.hdr(X-Shard),map(/usr/local/etc/haproxy/sharding.map)]
24
25 backend random
26   server b1 backend-1:8080 check
27   server b2 backend-2:8080 check
28   server b3 backend-3:8080 check
29
30 backend backend_1
31   server b1 backend-1:8080 check
32
33 backend backend_2
34   server b2 backend-2:8080 check
35
36 backend backend_3
37   server b3 backend-3:8080 check
38