HAProxy Enterprise Documentation 2.1r1

Overview

An HAProxy Enterprise configuration file, which is typically located at /etc/hapee-2.1/hapee-lb.cfg, is composed of named sections. The capabilities that each configuration section offers is different.

In the example below you can see a basic configuration file that contains the four essential sections of an HAProxy Enterprise configuration, global, defaults, frontend, and backend. Section names begin at the start of a line and all configuration directives of a section need to be indented.

global
 # process-level settings here

defaults
 # defaults here

frontend
 # a frontend that accepts requests from clients

backend
 # servers that fulfill the requests

You can enable extra functionality by using the various other sections, some of which require you to load a module before they become available.

HAProxy Enterprise Configuration sections

Besides the global section, you can use all other sections multiple times within your configuration. In general, the order of the sections does not matter. The defaults section is a special case where the order of appearance is important, since it applies default settings for any frontends and backends that follow it.

Below, we list all configuration sections and a short description of each.

Section

Description

global

The global section is unique, should be at the top of your configuration, and contains global configuration options.

frontend

Frontend sections define the IP addresses and ports that clients can connect to.

backend

Backend sections define pools of servers that HAProxy Enterprise forwards traffic to.

defaults

The defaults section can be used to set default values for all following frontend, backend, and listen sections. You can have multiple defaults sections. (and something about the ordering)

listen

A listen section combines the functions of frontend and backend.

aggregations

The aggregations section is part of HAProxy Enterprise's Stick Table Aggregator module functionality.

cache

A cache section enables caching of responses from backend servers.

dynamic-update

The dynamic-update section is part of HAProxy Enterprise's Update module functionality. It lets HAProxy Enterprise pull updated ACL and Map files from a remote server.

fcgi-app

A fcgi-app section defines how HAProxy Enterprise should connect to a FastCGI application.

http-errors

An http-errors section lists custom HTML files to return to clients when errors occur.

mailers

A mailers section lists message transfer agent (MTA) servers to which HAProxy Enterprise will forward error messages so that they can be distributed to email recipients. Emails are sent using the SMTP protocol.

peers

A peers section to enable replication of stick table data between two or more HAProxy Enterprise instances.

program

A program section enables the HAProrxy Process Manager which allows you to start external programs when HAProxy Enterprise starts.

resolvers

A resolvers section lists DNS nameservers that HAProxy Enterprise will query when it needs to resolve a hostname to an IP address.

userlist

A userlist section allows you to configure Basic authentication to restrict access to your proxied services.


Next up

Global