blob: ffe7891095e81c43a97d79409e4db9abc6fc113f [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
46name.
47
48.TP
Michael Shuler35928e82009-10-14 10:23:03 -050049\fB\-n <maxconn>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020050Set the high limit for the total number of simultaneous connections.
51
52.TP
Michael Shuler35928e82009-10-14 10:23:03 -050053\fB\-N <maxconn>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020054Set the high limit for the per-listener number of simultaneous connections.
55
56.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +030057\fB\-C <dir>\fP
58Change directory to <\fIdir\fP> before loading any files.
59
60.TP
61\fB\-v\fP
62Display HAProxy's version.
63
64.TP
65\fB\-vv\fP
66Display HAProxy's version and all build options.
67
68.TP
Michael Shuler35928e82009-10-14 10:23:03 -050069\fB\-d\fP
Jarno Huuskonen0e82b922014-04-12 18:22:19 +030070Start in foreground with debugging mode enabled.
Willy Tarreau031a26b2007-09-09 22:40:07 +020071When the proxy runs in this mode, it dumps every connections,
72disconnections, timestamps, and HTTP headers to stdout. This should
73NEVER be used in an init script since it will prevent the system from
74starting up.
75
76.TP
Michael Shuler35928e82009-10-14 10:23:03 -050077\fB\-D\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020078Start in daemon mode.
79
80.TP
William Lallemand95635dd2019-06-13 11:51:09 +020081\fB\-W\fP
82Start in master-worker mode. Could be used either with foreground or daemon
83mode.
84
85.TP
86\fB\-Ws\fP
87Start in master-worker mode with systemd notify support. It tells systemd when
88the process is ready. This mode forces foreground.
89
90.TP
Michael Shuler35928e82009-10-14 10:23:03 -050091\fB\-q\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +020092Disable messages on output.
93
94.TP
Michael Shuler35928e82009-10-14 10:23:03 -050095\fB\-V\fP
96Displays messages on output even when \-q or 'quiet' are specified. Some
Willy Tarreau031a26b2007-09-09 22:40:07 +020097information about pollers and config file are displayed during startup.
98
99.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500100\fB\-c\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200101Only checks config file and exits with code 0 if no error was found, or
102exits with code 1 if a syntax error was found.
103
104.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500105\fB\-p <pidfile>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200106Ask the process to write down each of its children's pids to this file
107in daemon mode.
108
109.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500110\fB\-dk\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300111Disable use of \fBkqueue\fP(2). \fBkqueue\fP(2) is available only on BSD systems.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200112
113.TP
Emmanuel Hocdet0ba4f482019-04-08 16:53:32 +0000114\fB\-dv\fP
115Disable use of event ports. Event ports are available only on SunOS systems
116derived from Solaris 10 and later (including illumos systems).
117
118.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500119\fB\-ds\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300120Disable use of speculative \fBepoll\fP(7). \fBepoll\fP(7) is available only on
121Linux 2.6 and some custom Linux 2.4 systems.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200122
123.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500124\fB\-de\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300125Disable use of \fBepoll\fP(7). \fBepoll\fP(7) is available only on Linux 2.6
Willy Tarreau031a26b2007-09-09 22:40:07 +0200126and some custom Linux 2.4 systems.
127
128.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500129\fB\-dp\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300130Disables use of \fBpoll\fP(2). \fBselect\fP(2) might be used instead.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200131
132.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300133\fB\-dS\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300134Disables use of \fBsplice\fP(2), which is broken on older kernels.
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300135
136.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500137\fB\-db\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200138Disables background mode (stays in foreground, useful for debugging).
Michael Shuler35928e82009-10-14 10:23:03 -0500139For debugging, the '\-db' option is very useful as it temporarily
Willy Tarreau031a26b2007-09-09 22:40:07 +0200140disables daemon mode and multi-process mode. The service can then be
141stopped by simply pressing Ctrl-C, without having to edit the config nor
142run full debug.
143
144.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300145\fB\-dM[<byte>]\fP
146Initializes all allocated memory areas with the given <\fIbyte\fP>. This makes
147it easier to detect bugs resulting from uninitialized memory accesses, at the
148expense of touching all allocated memory once. If <\fIbyte\fP> is not
149specified, it defaults to 0x50 (ASCII 'P').
150
151.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500152\fB\-m <megs>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200153Enforce a memory usage limit to a maximum of <megs> megabytes.
154
155.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500156\fB\-sf <pidlist>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200157Send FINISH signal to the pids in pidlist after startup. The processes
158which receive this signal will wait for all sessions to finish before
159exiting. This option must be specified last, followed by any number of
160PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent.
161
162.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500163\fB\-st <pidlist>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200164Send TERMINATE signal to the pids in pidlist after startup. The processes
Jorrit Schippers1458fdb2016-04-09 20:30:38 +0200165which receive this signal will terminate immediately, closing all active
166sessions. This option must be specified last, followed by any number of
167PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200168
Olivier Houchardd33fc3a2017-04-05 22:50:59 +0200169.TP
170\f8\-x <unix_socket>\fP
171Attempt to connect to the unix socket, and retrieve all the listening sockets
172from the old process. Those sockets will then be used if possible instead of
173binding new ones.
174
Willy Tarreau031a26b2007-09-09 22:40:07 +0200175.SH LOGGING
176Since HAProxy can run inside a chroot, it cannot reliably access /dev/log.
177For this reason, it uses the UDP protocol to send its logs to the server,
178even if it is the local server. People who experience trouble receiving
179logs should ensure that their syslog daemon listens to the UDP socket.
180Several Linux distributions which ship with syslogd from the sysklogd
Michael Shuler35928e82009-10-14 10:23:03 -0500181package have UDP disabled by default. The \fB\-r\fP option must be passed
Willy Tarreau031a26b2007-09-09 22:40:07 +0200182to the daemon in order to enable UDP.
183
184.SH SIGNALS
185Some signals have a special meaning for the haproxy daemon. Generally, they are used between daemons and need not be used by the administrator.
186.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500187\- \fBSIGUSR1\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200188Tells the daemon to stop all proxies and exit once all sessions are closed. It is often referred to as the "soft-stop" signal.
189.TP
William Lallemand95635dd2019-06-13 11:51:09 +0200190\- \fBSIGUSR2\fP
191In master-worker mode, reloads the configuration and sends a soft-stop signal to old processes.
192.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500193\- \fBSIGTTOU\fP
194Tells 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 +0200195.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500196\- \fBSIGTTIN\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200197Tells the daemon to restart listening to all sockets after a \fBSIGTTOU\fP. Used internally when there was a problem during hot reconfiguration.
198.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500199\- \fBSIGINT\fP and \fBSIGTERM\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200200Both signals can be used to quickly stop the daemon.
201.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500202\- \fBSIGHUP\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200203Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes.
204.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500205\- \fBSIGQUIT\fP
Willy Tarreaud153b3b2014-01-25 18:19:32 +0100206Dumps information about memory pools on stderr. Mostly used for debugging purposes.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200207.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500208\- \fBSIGPIPE\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200209This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP.
210
211.SH SEE ALSO
212
Apollon Oikonomopoulos2e979572013-09-29 23:04:13 +0300213A much better documentation can be found in configuration.txt. On Debian
214systems, you can find this file in /usr/share/doc/haproxy/configuration.txt.gz.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200215
216.SH AUTHOR
217
218HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau.
219