haproxy/backend/config¶
Configuration options for HAProxy backend services
HAProxy Backend Configuration¶
This parameter defines configuration options for HAProxy backend sections, allowing per-service customization of load balancing, health checks, and other backend-specific settings.
For full documentation of all available directives, refer to the HAProxy Configuration Manual: https://www.haproxy.com/documentation/haproxy-configuration-manual/latest/#4.1
Requirements¶
- Must use valid HAProxy backend configuration syntax
mode
must match corresponding frontend service- Balance algorithm must be appropriate for the service type
Usage¶
Configure backend settings with mode
, balance algorithm, and optional custom configuration:
haproxy/backend/config:
http:
mode: http
balance: roundrobin
postgres:
mode: tcp
balance: leastconn
config: |
option mysql-check user haproxy
custom:
mode: tcp
config: |
stick-table type ip size 200k expire 30m
stick on src
The configuration supports:
- mode
: Connection mode (tcp/http/log)
- balance
: Load balancing algorithm
- config
: Custom configuration block for advanced settings
Common balance algorithms:
- roundrobin
: Each server is used in turns
- leastconn
: Server with least connections receives the connection
- source
: Based on source IP hash
- uri
: Based on URI hash for HTTP services