feat: Working config for HAProxy mit mapping via `X-Shard` (casesensitive!)
[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 10s
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   use_backend %[req.hdr(X-Shard),map(/usr/local/etc/haproxy/sharding.map)]
23
24 backend backend_1
25   server b1 backend-1:8080 check
26
27 backend backend_2
28   server b2 backend-2:8080 check
29
30 backend backend_3
31   server b3 backend-3:8080 check
32