feat: Added a default backend, that picks the server randomly
authorKai Moritz <kai@juplo.de>
Sun, 15 Jan 2023 18:16:09 +0000 (19:16 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 15 Jan 2023 18:16:09 +0000 (19:16 +0100)
haproxy.cfg

index 0dd9ac5..2177daa 100644 (file)
@@ -19,8 +19,14 @@ frontend stats
 
 frontend frontend
   bind :8400
+  default_backend random
   use_backend %[req.hdr(X-Shard),map(/usr/local/etc/haproxy/sharding.map)]
 
+backend random
+  server b1 backend-1:8080 check
+  server b2 backend-2:8080 check
+  server b3 backend-3:8080 check
+
 backend backend_1
   server b1 backend-1:8080 check