blob: 7554f9d9f80861a5e1cbf40e6534a38de455e4b8 [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
108in daemon mode.
109
110.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500111\fB\-dk\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300112Disable use of \fBkqueue\fP(2). \fBkqueue\fP(2) is available only on BSD systems.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200113
114.TP
Emmanuel Hocdet0ba4f482019-04-08 16:53:32 +0000115\fB\-dv\fP
116Disable use of event ports. Event ports are available only on SunOS systems
117derived from Solaris 10 and later (including illumos systems).
118
119.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500120\fB\-ds\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300121Disable use of speculative \fBepoll\fP(7). \fBepoll\fP(7) is available only on
122Linux 2.6 and some custom Linux 2.4 systems.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200123
124.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500125\fB\-de\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300126Disable use of \fBepoll\fP(7). \fBepoll\fP(7) is available only on Linux 2.6
Willy Tarreau031a26b2007-09-09 22:40:07 +0200127and some custom Linux 2.4 systems.
128
129.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500130\fB\-dp\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300131Disables use of \fBpoll\fP(2). \fBselect\fP(2) might be used instead.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200132
133.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300134\fB\-dS\fP
Apollon Oikonomopoulos7ef0edf2013-09-29 23:03:51 +0300135Disables use of \fBsplice\fP(2), which is broken on older kernels.
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300136
137.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500138\fB\-db\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200139Disables background mode (stays in foreground, useful for debugging).
Michael Shuler35928e82009-10-14 10:23:03 -0500140For debugging, the '\-db' option is very useful as it temporarily
Willy Tarreau031a26b2007-09-09 22:40:07 +0200141disables daemon mode and multi-process mode. The service can then be
142stopped by simply pressing Ctrl-C, without having to edit the config nor
143run full debug.
144
145.TP
Apollon Oikonomopoulos6712bb72013-09-29 23:03:37 +0300146\fB\-dM[<byte>]\fP
147Initializes all allocated memory areas with the given <\fIbyte\fP>. This makes
148it easier to detect bugs resulting from uninitialized memory accesses, at the
149expense of touching all allocated memory once. If <\fIbyte\fP> is not
150specified, it defaults to 0x50 (ASCII 'P').
151
152.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500153\fB\-m <megs>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200154Enforce a memory usage limit to a maximum of <megs> megabytes.
155
156.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500157\fB\-sf <pidlist>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200158Send FINISH signal to the pids in pidlist after startup. The processes
159which receive this signal will wait for all sessions to finish before
160exiting. This option must be specified last, followed by any number of
161PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent.
162
163.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500164\fB\-st <pidlist>\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200165Send TERMINATE signal to the pids in pidlist after startup. The processes
Jorrit Schippers1458fdb2016-04-09 20:30:38 +0200166which receive this signal will terminate immediately, closing all active
167sessions. This option must be specified last, followed by any number of
168PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200169
Olivier Houchardd33fc3a2017-04-05 22:50:59 +0200170.TP
171\f8\-x <unix_socket>\fP
172Attempt to connect to the unix socket, and retrieve all the listening sockets
173from the old process. Those sockets will then be used if possible instead of
174binding new ones.
175
William Lallemand63329e32019-06-13 17:03:37 +0200176.TP
177\fB\-S <bind>[,<bind options>...]\fP
178In master-worker mode, create a master CLI. This CLI will enable access to the
179CLI of every worker. Useful for debugging, it's a convenient way of accessing a
180leaving process.
181
Willy Tarreau031a26b2007-09-09 22:40:07 +0200182.SH LOGGING
183Since HAProxy can run inside a chroot, it cannot reliably access /dev/log.
184For this reason, it uses the UDP protocol to send its logs to the server,
185even if it is the local server. People who experience trouble receiving
186logs should ensure that their syslog daemon listens to the UDP socket.
187Several Linux distributions which ship with syslogd from the sysklogd
Michael Shuler35928e82009-10-14 10:23:03 -0500188package have UDP disabled by default. The \fB\-r\fP option must be passed
Willy Tarreau031a26b2007-09-09 22:40:07 +0200189to the daemon in order to enable UDP.
190
191.SH SIGNALS
192Some signals have a special meaning for the haproxy daemon. Generally, they are used between daemons and need not be used by the administrator.
193.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500194\- \fBSIGUSR1\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200195Tells the daemon to stop all proxies and exit once all sessions are closed. It is often referred to as the "soft-stop" signal.
196.TP
William Lallemand95635dd2019-06-13 11:51:09 +0200197\- \fBSIGUSR2\fP
198In master-worker mode, reloads the configuration and sends a soft-stop signal to old processes.
199.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500200\- \fBSIGTTOU\fP
201Tells 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 +0200202.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500203\- \fBSIGTTIN\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200204Tells the daemon to restart listening to all sockets after a \fBSIGTTOU\fP. Used internally when there was a problem during hot reconfiguration.
205.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500206\- \fBSIGINT\fP and \fBSIGTERM\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200207Both signals can be used to quickly stop the daemon.
208.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500209\- \fBSIGHUP\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200210Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes.
211.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500212\- \fBSIGQUIT\fP
Willy Tarreaud153b3b2014-01-25 18:19:32 +0100213Dumps information about memory pools on stderr. Mostly used for debugging purposes.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200214.TP
Michael Shuler35928e82009-10-14 10:23:03 -0500215\- \fBSIGPIPE\fP
Willy Tarreau031a26b2007-09-09 22:40:07 +0200216This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP.
217
218.SH SEE ALSO
219
Apollon Oikonomopoulos2e979572013-09-29 23:04:13 +0300220A much better documentation can be found in configuration.txt. On Debian
221systems, you can find this file in /usr/share/doc/haproxy/configuration.txt.gz.
Willy Tarreau031a26b2007-09-09 22:40:07 +0200222
223.SH AUTHOR
224
225HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau.
226