blob: 4c2d78677d7f8971b4a0c94b6e7d349991da4999 [file] [log] [blame]
Willy Tarreau031a26b2007-09-09 22:40:07 +02001.TH HAPROXY 1 "17 August 2007"
2
3.SH NAME
4
5HAProxy \- fast and reliable http reverse proxy and load balancer
6
7.SH SYNOPSIS
8
William Lallemand95635dd2019-06-13 11:51:09 +02009haproxy \-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...]
Willy Tarreau031a26b2007-09-09 22:40:07 +020010
11.SH DESCRIPTION
12
13HAProxy is a TCP/HTTP reverse proxy which is particularly suited for
14high availability environments. Indeed, it can:
15 \- route HTTP requests depending on statically assigned cookies ;
16 \- spread the load among several servers while assuring server
17 persistence through the use of HTTP cookies ;
18 \- switch to backup servers in the event a main one fails ;
19 \- accept connections to special ports dedicated to service
20 monitoring ;
21 \- stop accepting connections without breaking existing ones ;
22 \- add/modify/delete HTTP headers both ways ;
23 \- block requests matching a particular pattern ;
24 \- hold clients to the right application server depending on
25 application cookies
26 \- report detailed status as HTML pages to authenticated users from an
27 URI intercepted from the application.
28
29It needs very little resource. Its event-driven architecture allows it
30to easily handle thousands of simultaneous connections on hundreds of
31instances without risking the system's stability.
32
33.SH OPTIONS
34
35.TP
Maxime de Roucy379d9c72016-05-13 23:52:56 +020036\fB\-f <configuration file|dir>\fP
37Specify configuration file or directory path. If the argument is a directory
Tim Düsterhus4896c442016-11-29 02:15:19 +010038the files (and only files) it contains are added in lexical order (using
Maxime de Roucye3841392016-05-18 23:13:38 +020039LC_COLLATE=C) ; only non hidden files with ".cfg" extension are added.
Willy Tarreau031a26b2007-09-09 22:40:07 +020040
41.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +030042\fB\-L <name>\fP
43Set the local instance's peer name. Peers are defined in the \fBpeers\fP
44configuration section and used for syncing stick tables between different
45instances. If this option is not specified, the local hostname is used as peer
William Lallemandc5473e52019-06-13 15:39:48 +020046name. This name is exported in the $HAPROXY_LOCALPEER environment variable and
47can be used in the configuration file.
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +030048
49.TP
Michael Shuler35928e82009-10-14 10:23:03 -050050\fB\-n <maxconn>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020051Set the high limit for the total number of simultaneous connections.
52
53.TP
Michael Shuler35928e82009-10-14 10:23:03 -050054\fB\-N <maxconn>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020055Set the high limit for the per-listener number of simultaneous connections.
56
57.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +030058\fB\-C <dir>\fP
59Change directory to <\fIdir\fP> before loading any files.
60
61.TP
62\fB\-v\fP
63Display HAProxy's version.
64
65.TP
66\fB\-vv\fP
67Display HAProxy's version and all build options.
68
69.TP
Michael Shuler35928e82009-10-14 10:23:03 -050070\fB\-d\fP
Jarno Huuskonen0e82b922014-04-12 18:22:19 +030071Start in foreground with debugging mode enabled.
Willy Tarreau031a26b2007-09-09 22:40:07 +020072When the proxy runs in this mode, it dumps every connections,
73disconnections, timestamps, and HTTP headers to stdout. This should
74NEVER be used in an init script since it will prevent the system from
75starting up.
76
77.TP
Michael Shuler35928e82009-10-14 10:23:03 -050078\fB\-D\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020079Start in daemon mode.
80
81.TP
William Lallemand95635dd2019-06-13 11:51:09 +020082\fB\-W\fP
83Start in master-worker mode. Could be used either with foreground or daemon
84mode.
85
86.TP
87\fB\-Ws\fP
88Start in master-worker mode with systemd notify support. It tells systemd when
89the process is ready. This mode forces foreground.
90
91.TP
Michael Shuler35928e82009-10-14 10:23:03 -050092\fB\-q\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020093Disable messages on output.
94
95.TP
Michael Shuler35928e82009-10-14 10:23:03 -050096\fB\-V\fP
97Displays messages on output even when \-q or 'quiet' are specified. Some
Willy Tarreau031a26b2007-09-09 22:40:07 +020098information about pollers and config file are displayed during startup.
99
100.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500101\fB\-c\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200102Only checks config file and exits with code 0 if no error was found, or
103exits with code 1 if a syntax error was found.
104
105.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500106\fB\-p <pidfile>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200107Ask the process to write down each of its children's pids to this file
MIZUTA Takeshic32f3942020-08-26 13:46:19 +0900108in daemon mode or ask the process to write down its master's pid to
109this file in master-worker mode.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200110
111.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500112\fB\-dk\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300113Disable use of \fBkqueue\fP(2). \fBkqueue\fP(2) is available only on BSD systems.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200114
115.TP
Emmanuel Hocdet0ba4f482019-04-08 16:53:32 +0000116\fB\-dv\fP
117Disable use of event ports. Event ports are available only on SunOS systems
118derived from Solaris 10 and later (including illumos systems).
119
120.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500121\fB\-ds\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300122Disable use of speculative \fBepoll\fP(7). \fBepoll\fP(7) is available only on
123Linux 2.6 and some custom Linux 2.4 systems.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200124
125.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500126\fB\-de\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300127Disable use of \fBepoll\fP(7). \fBepoll\fP(7) is available only on Linux 2.6
Willy Tarreau031a26b2007-09-09 22:40:07 +0200128and some custom Linux 2.4 systems.
129
130.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500131\fB\-dp\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300132Disables use of \fBpoll\fP(2). \fBselect\fP(2) might be used instead.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200133
134.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300135\fB\-dS\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300136Disables use of \fBsplice\fP(2), which is broken on older kernels.
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300137
138.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500139\fB\-db\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200140Disables background mode (stays in foreground, useful for debugging).
Michael Shuler35928e82009-10-14 10:23:03 -0500141For debugging, the '\-db' option is very useful as it temporarily
Willy Tarreau031a26b2007-09-09 22:40:07 +0200142disables daemon mode and multi-process mode. The service can then be
143stopped by simply pressing Ctrl-C, without having to edit the config nor
144run full debug.
145
146.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300147\fB\-dM[<byte>]\fP
148Initializes all allocated memory areas with the given <\fIbyte\fP>. This makes
149it easier to detect bugs resulting from uninitialized memory accesses, at the
150expense of touching all allocated memory once. If <\fIbyte\fP> is not
151specified, it defaults to 0x50 (ASCII 'P').
152
153.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500154\fB\-m <megs>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200155Enforce a memory usage limit to a maximum of <megs> megabytes.
156
157.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500158\fB\-sf <pidlist>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200159Send FINISH signal to the pids in pidlist after startup. The processes
160which receive this signal will wait for all sessions to finish before
161exiting. This option must be specified last, followed by any number of
162PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent.
163
164.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500165\fB\-st <pidlist>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200166Send TERMINATE signal to the pids in pidlist after startup. The processes
Jorrit Schippers1458fdb2016-04-09 20:30:38 +0200167which receive this signal will terminate immediately, closing all active
168sessions. This option must be specified last, followed by any number of
169PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200170
Olivier Houchardd33fc3a2017-04-05 22:50:59 +0200171.TP
172\f8\-x <unix_socket>\fP
173Attempt to connect to the unix socket, and retrieve all the listening sockets
174from the old process. Those sockets will then be used if possible instead of
175binding new ones.
176
William Lallemand63329e32019-06-13 17:03:37 +0200177.TP
178\fB\-S <bind>[,<bind options>...]\fP
179In master-worker mode, create a master CLI. This CLI will enable access to the
180CLI of every worker. Useful for debugging, it's a convenient way of accessing a
181leaving process.
182
Willy Tarreau031a26b2007-09-09 22:40:07 +0200183.SH LOGGING
184Since HAProxy can run inside a chroot, it cannot reliably access /dev/log.
185For this reason, it uses the UDP protocol to send its logs to the server,
186even if it is the local server. People who experience trouble receiving
187logs should ensure that their syslog daemon listens to the UDP socket.
188Several Linux distributions which ship with syslogd from the sysklogd
Michael Shuler35928e82009-10-14 10:23:03 -0500189package have UDP disabled by default. The \fB\-r\fP option must be passed
Willy Tarreau031a26b2007-09-09 22:40:07 +0200190to the daemon in order to enable UDP.
191
192.SH SIGNALS
193Some signals have a special meaning for the haproxy daemon. Generally, they are used between daemons and need not be used by the administrator.
194.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500195\- \fBSIGUSR1\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200196Tells the daemon to stop all proxies and exit once all sessions are closed. It is often referred to as the "soft-stop" signal.
197.TP
William Lallemand95635dd2019-06-13 11:51:09 +0200198\- \fBSIGUSR2\fP
199In master-worker mode, reloads the configuration and sends a soft-stop signal to old processes.
200.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500201\- \fBSIGTTOU\fP
202Tells the daemon to stop listening to all sockets. Used internally by \fB\-sf\fP and \fB\-st\fP.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200203.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500204\- \fBSIGTTIN\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200205Tells the daemon to restart listening to all sockets after a \fBSIGTTOU\fP. Used internally when there was a problem during hot reconfiguration.
206.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500207\- \fBSIGINT\fP and \fBSIGTERM\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200208Both signals can be used to quickly stop the daemon.
209.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500210\- \fBSIGHUP\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200211Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes.
212.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500213\- \fBSIGQUIT\fP
Willy Tarreaud153b3b2014-01-25 18:19:32 +0100214Dumps information about memory pools on stderr. Mostly used for debugging purposes.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200215.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500216\- \fBSIGPIPE\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200217This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP.
218
219.SH SEE ALSO
220
Apollon Oikonomopoulos2e979572013-09-29 23:04:13 +0300221A much better documentation can be found in configuration.txt. On Debian
222systems, you can find this file in /usr/share/doc/haproxy/configuration.txt.gz.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200223
224.SH AUTHOR
225
226HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau.
227