Difference between frontend/backend and listen in haproxy

All three are called “proxies.”

A listen is a combined frontend and backend. A listen has an implicit default_backend of itself, but the frontend logic of a listen can use other backends and its backend section can be used by other frontends. Fundamentally it just keep configuration more compact for simple rules, but otherwise it’s almost the same as declaring a separate frontend and backend of the same name, while keeping the config together.

A “listen” section defines a complete proxy with its frontend and backend
parts combined in one section. It is generally useful for TCP-only traffic.

http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4

It’s paricularly useful for TCP because such configurations are usually simpler than HTTP. But a listen proxy can be used for either application.

Leave a Comment