HAPROXY(1)
๐ HAPROXY(1) โ General Commands Manual ๐
okay bestie, sit down, we're doing the HAProxy manual page and honestly? it's giving legendary. this lives in the General Commands Manual section of your system, and it's the whole vibe of the tool. no cap.
โจ NAME โจ
HAProxy โ fast and reliable http reverse proxy and load balancer ๐ฆ
like. that's it. that's the whole name section. iconic, brief, slay.
๐ธ SYNOPSIS ๐ธ
haproxy -f <configuration file|dir> [-L <name>] [-n maxconn]
[-N maxconn] [-C <dir>] [-v|-vv] [-d] [-D] [-W] [-Ws] [-q] [-V] [-c]
[-p <pidfile>] [-dk] [-ds] [-de] [-dp] [-db] [-dM[<byte>]] [-m <megs>]
[-x <unix_socket>] [{-sf|-st} pidlist...]
lowkey the whole energy is "give me a config file and I will handle literally everything else for you" ๐
๐ DESCRIPTION ๐
HAProxy is a TCP/HTTP reverse proxy and it's particularly suited for high availability environments. like, this is its whole personality. and it can, fr fr:
- route HTTP requests depending on statically assigned cookies ;
- spread the load among several servers while assuring server persistence through the use of HTTP cookies ;
- switch to backup servers in the event a main one fails ;
- accept connections to special ports dedicated to service monitoring ;
- stop accepting connections without breaking existing ones ;
- add/modify/delete HTTP headers both ways ;
- block requests matching a particular pattern ;
- hold clients to the right application server depending on application cookies
- report detailed status as HTML pages to authenticated users from an URI intercepted from the application.
and the way that it needs very little resource?? obsessed. its event-driven architecture lets it easily handle thousands of simultaneous connections across hundreds of instances without ever risking the system's stability. main character energy, honestly. ๐ซถ
๐ OPTIONS ๐
bestie this is the part you actually came for. every single one, no skipping, we don't do that here โจ
-f <configuration file|dir>โ give it a config file or a directory path. if you hand it a directory, all the files it contains get added in lexical order (usingLC_COLLATE=C), and here's the catch: only files (not dirs), only non hidden files, and only ones with the.cfgextension. gatekeeping the whole folder, as it should ๐-L <name>โ set the local instance's peer name. peers are defined over in the peers configuration section and they're used for syncing stick tables between different instances. if you don't pass this, the local hostname becomes the peer name. this name gets exported in the$HAPROXY_LOCALPEERenvironment variable so you can use it in the config file. cute, right?-n <maxconn>โ sets the high limit for the total number of simultaneous connections. that's the whole ceiling, bestie.-N <maxconn>โ same energy but per-listener: the high limit for the per-listener number of simultaneous connections.-C <dir>โ change directory to<dir>before loading any files. simple as.-vโ display HAProxy's version. that's it. quick lil flex.-vvโ display HAProxy's version and all build options. the full tea โ-dโ start in foreground with debugging mode enabled. when the proxy runs in this mode it dumps every connection, disconnection, timestamp, and HTTP header to stdout. and listen โ this should NEVER be used in an init script because it will prevent the system from starting up. I said what I said. ๐-Dโ start in daemon mode.-Wโ start in master-worker mode. you can use it with either foreground or daemon mode, flexible queen.-Wsโ start in master-worker mode with systemd notify support. it tells systemd when the process is ready. this mode forces foreground.-qโ disable messages on output. shhh. ๐คซ-Vโ displays messages on output even when-qor'quiet'are specified. some info about pollers and the config file gets shown during startup.-cโ only checks the config file and exits with code0if no error was found, or exits with code1if a syntax error was found. vibe check for your config ๐-p <pidfile>โ ask the process to write down each of its children's pids to this file in daemon mode, or ask the process to write down its master's pid to this file in master-worker mode.-dkโ disable use ofkqueue(2).kqueue(2)is available only on BSD systems.-dvโ disable use of event ports. event ports are available only on SunOS systems derived from Solaris 10 and later (including illumos systems).-dsโ disable use of speculativeepoll(7).epoll(7)is available only on Linux 2.6 and some custom Linux 2.4 systems.-deโ disable use ofepoll(7).epoll(7)is available only on Linux 2.6 and some custom Linux 2.4 systems.-dpโ disables use ofpoll(2).select(2)might be used instead.-dSโ disables use ofsplice(2), which is broken on older kernels. noted, moving on.-dbโ disables background mode (stays in foreground, useful for debugging). for debugging, the'-db'option is very useful as it temporarily disables daemon mode and multi-process mode. the service can then be stopped by simply pressingCtrl-C, without having to edit the config nor run full debug. so convenient, honestly.-dM[<byte>]โ initializes all allocated memory areas with the given<byte>. this makes it easier to detect bugs resulting from uninitialized memory accesses, at the expense of touching all allocated memory once. if<byte>is not specified, it defaults to0x50(ASCII'P'). cute default ngl.-m <megs>โ enforce a memory usage limit to a maximum of<megs>megabytes. boundaries, we love to see them ๐-sf <pidlist>โ send FINISH signal to the pids in pidlist after startup. the processes which receive this signal will wait for all sessions to finish before exiting. this option must be specified last, followed by any number of PIDs. technically speaking,SIGTTOUandSIGUSR1are sent.-st <pidlist>โ send TERMINATE signal to the pids in pidlist after startup. the processes which receive this signal will terminate immediately, closing all active sessions. this option must be specified last, followed by any number of PIDs. technically speaking,SIGTTOUandSIGTERMare sent. no soft landing here ๐ญ-x <unix_socket>โ attempt to connect to the unix socket, and retrieve all the listening sockets from the old process. those sockets will then be used if possible instead of binding new ones.-S <bind>[,<bind options>...]โ in master-worker mode, create a master CLI. this CLI enables access to the CLI of every worker. useful for debugging, it's a convenient way of accessing a leaving process.
๐ LOGGING ๐
so since HAProxy can run inside a chroot, it cannot reliably access /dev/log. for this reason it uses the UDP protocol to send its logs to the server, even if it's the local server. if you're experiencing trouble receiving logs, make sure your syslog daemon is actually listening on the UDP socket bestie. several Linux distributions that ship with syslogd from the sysklogd package have UDP disabled by default, and the -r option must be passed to the daemon in order to enable UDP.
๐ฆ SIGNALS ๐ฆ
some signals have a special meaning for the haproxy daemon. generally they're used between daemons and you as the administrator don't need to touch them, iykyk.
SIGUSR1โ tells the daemon to stop all proxies and exit once all sessions are closed. often referred to as the "soft-stop" signal. gentle queen ๐ธSIGUSR2โ in master-worker mode, reloads the configuration and sends a soft-stop signal to old processes.SIGTTOUโ tells the daemon to stop listening to all sockets. used internally by-sfand-st.SIGTTINโ tells the daemon to restart listening to all sockets after aSIGTTOU. used internally when there was a problem during hot reconfiguration.SIGINTandSIGTERMโ both signals can be used to quickly stop the daemon. no ceremony ๐SIGHUPโ dumps the status of all proxies and servers into the logs. mostly used for trouble-shooting purposes.SIGQUITโ dumps information about memory pools onstderr. mostly used for debugging purposes.SIGPIPEโ this signal is intercepted and ignored on systems withoutMSG_NOSIGNAL. built different, fr.
๐ SEE ALSO ๐
a much better documentation can be found in configuration.txt. on Debian systems, you can find this file in /usr/share/doc/haproxy/configuration.txt.gz. go read it bestie, it's the real tea โจ
๐ AUTHOR ๐
HAProxy was written by Willy Tarreau. this man page was written by Arnaud Cornet and Willy Tarreau. legends only, honestly ๐
and that's the whole page, pookie ๐ซถ this version of the page comes from the HAPROXY(1) manual as of 17 August 2007. old but absolutely still iconic. periodt. ๐โจ
๐ฆ where this page comes from
- alpine 3.22: haproxy-doc 3.2.26-r0 ยท GPL-2.0-or-later WITH OpenSSL-Exception
- alpine 3.23: haproxy-doc 3.2.26-r0 ยท GPL-2.0-or-later WITH OpenSSL-Exception
- alpine 3.24: haproxy-doc 3.4.7-r0 ยท GPL-2.0-or-later WITH OpenSSL-Exception
- arch rolling: haproxy 3.4.7-1 ยท GPL-2.0-or-later
- centos-stream 10: haproxy 3.0.5-8.el10 ยท GPL-2.0-or-later
- centos-stream 9: haproxy 2.8.14-4.el9 ยท GPLv2+
- debian bookworm: haproxy 2.6.12-1+deb12u3 ยท GPL-2.0-or-later
- debian bookworm: haproxy 2.6.12-1+deb12u4 ยท GPL-2.0-or-later
- debian trixie: haproxy 3.0.11-1+deb13u3 ยท GPL-2.0-or-later
- debian trixie: haproxy 3.0.11-1+deb13u4 ยท GPL-2.0-or-later
- fedora 43: haproxy 3.0.28-1.fc43
- fedora 43: haproxy 3.0.29-1.fc43
- fedora 43: haproxy 3.0.30-1.fc43 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 43: haproxy 3.0.5-4.fc43 ยท GPL-2.0-or-later
- fedora 44: haproxy 3.0.28-1.fc44
- fedora 44: haproxy 3.0.29-1.fc44
- fedora 44: haproxy 3.0.30-1.fc44 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: haproxy 3.0.5-5.fc44 ยท GPL-2.0-or-later
- nixos 26.05: haproxy 3.3.17
- nixpkgs unstable: haproxy 3.4.7
- opensuse-leap 16.0: haproxy 3.4.7+git0.8872a2604-160000.1.1 ยท GPL-3.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: haproxy 3.4.7+git0.8872a2604-160000.1.1 ยท GPL-3.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: haproxy 3.4.7+git0.8872a2604-160000.1.1 ยท GPL-3.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: haproxy 3.4.7+git0.8872a2604-160000.1.1 ยท GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu jammy: haproxy 2.4.14-1ubuntu1 ยท GPL-2.0-or-later
- ubuntu jammy: haproxy 2.4.30-0ubuntu0.22.04.2 ยท GPL-2.0-or-later
- ubuntu jammy: haproxy 2.4.30-0ubuntu0.22.04.3 ยท GPL-2.0-or-later
- ubuntu noble: haproxy 2.8.16-0ubuntu0.24.04.3 ยท GPL-2.0-or-later
- ubuntu noble: haproxy 2.8.30-0ubuntu0.24.04.1 ยท GPL-2.0-or-later
- ubuntu noble: haproxy 2.8.30-0ubuntu0.24.04.2 ยท GPL-2.0-or-later
- ubuntu noble: haproxy 2.8.5-1ubuntu3 ยท GPL-2.0-or-later
- ubuntu questing: haproxy 3.0.10-1ubuntu3
- ubuntu questing: haproxy 3.0.12-0ubuntu0.25.10.5
- ubuntu resolute: haproxy 3.2.25-0ubuntu0.26.04.1 ยท GPL-2.0-or-later
- ubuntu resolute: haproxy 3.2.25-0ubuntu0.26.04.2 ยท GPL-2.0-or-later
- ubuntu resolute: haproxy 3.2.9-1ubuntu2 ยท GPL-2.0-or-later
- ubuntu resolute: haproxy 3.2.9-1ubuntu2.2 ยท GPL-2.0-or-later
- ubuntu stonking: haproxy 3.4.2-1ubuntu4 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms