Skip to content

P2-11 — Advanced backend configuration: multiple backends and load-balancing modes #174

@bihius

Description

@bihius

Summary

Extend the HAProxy config generation to support richer, real-world deployment topologies that go beyond the current single-backend MVP model.

Motivation

The current implementation generates a fixed single-backend HAProxy configuration. Production deployments commonly require:

  • Multiple named backend pools (e.g. split by service, tenant, or region)
  • Different load-balancing algorithms per backend
  • Health-check tuning per backend

Proposed scope

Multiple backends

  • Allow the admin to define more than one backend pool, each with its own set of upstream servers and settings.
  • The config generator must produce a separate backend block for each pool and wire the correct ACL / use_backend rules in the frontend.

Load-balancing modes

Support at minimum the following HAProxy algorithms, selectable per backend:

Algorithm HAProxy keyword
Round-robin (default) roundrobin
Least connections leastconn
Source IP hash source
URI hash uri
Random random

Health checks

  • Configurable check interval, rise, and fall thresholds per backend.

Out of scope (for this issue)

  • Sticky sessions / cookie-based persistence (separate issue if needed)
  • mTLS between HAProxy and upstreams

Acceptance criteria

  • Data model extended to store multiple backends per proxy rule
  • Config generator produces syntactically valid multi-backend HAProxy config (haproxy -c passes)
  • Admin UI allows creating/editing backends and selecting the load-balancing algorithm
  • Unit tests for new config generation paths
  • Integration tests for new API endpoints

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/devopsDocker, Compose, CI, deploymentarea/wafHAProxy, Coraza, CRS, SPOEp2-post-mvpNice to have, deferred

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions