From 236e6d115fb0c0d1ab54ea8e6acd31fad04986ee Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 15 Jan 2023 19:16:09 +0100 Subject: [PATCH] feat: Added a default backend, that picks the server randomly --- haproxy.cfg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/haproxy.cfg b/haproxy.cfg index 0dd9ac52..2177daa2 100644 --- a/haproxy.cfg +++ b/haproxy.cfg @@ -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 -- 2.20.1