Skip to content

haproxy/config/default

Configuration options for HAProxy backend services

HAProxy Default Configuration

This parameter defines the default settings that apply to all frontend and backend sections unless overridden. It establishes baseline behavior for connections, timeouts, and error handling.

For full documentation refer to: https://www.haproxy.com/documentation/haproxy-configuration-tutorials/core-concepts/defaults/

Requirements

  • Must use valid HAProxy configuration syntax
  • Timeout values must be appropriate for your services
  • Mode setting must be compatible with your services

Usage

Configure default HAProxy settings:

haproxy/config/default: |
  mode                    tcp
  log                     global
  option                  dontlognull
  option                  http-server-close
  option                  redispatch
  retries                 3
  timeout http-request    10s
  timeout queue           1m
  timeout connect        10s
  timeout client          1m
  timeout server          1m
  timeout http-keep-alive 10s
  timeout check           10s
  maxconn                 3000

Common configuration options: - mode: Protocol mode (tcp/http) - timeout: Various timeout settings - option: Protocol and behavior options - maxconn: Maximum connections per frontend