Core concepts

Listeners

On this page

A listen section, also called a listener, serves as both a frontend, which listens to incoming traffic, and a backend, which specifies the web servers to which the load balancer sends the traffic.

Info

This combined role can be a simple choice for some applications, but for more complex applications, listeners are not ideal. In applications composed of multiple web domains and multiple pools of web servers, combining both functions can result in an unnecessarily complicated configuration. In these cases, we recommend that you define frontend and backend sections instead of listen sections.

The following example listen section is typical because it is used for a simple TCP application. This listener defines the pool of upstream load balancers for a two-tier active-active high availability configuration.

haproxy
listen load_balancer_cluster
mode tcp
bind :80
option tcplog
balance roundrobin
server lb1 192.168.1.25:80 check
server lb2 192.168.1.26:80 check
haproxy
listen load_balancer_cluster
mode tcp
bind :80
option tcplog
balance roundrobin
server lb1 192.168.1.25:80 check
server lb2 192.168.1.26:80 check

See also Jump to heading

Do you have any suggestions on how we can improve the content of this page?