Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 1 | .TH HAPROXY 1 "17 August 2007" |
| 2 | |
| 3 | .SH NAME |
| 4 | |
| 5 | HAProxy \- fast and reliable http reverse proxy and load balancer |
| 6 | |
| 7 | .SH SYNOPSIS |
| 8 | |
William Lallemand | 95635dd | 2019-06-13 11:51:09 +0200 | [diff] [blame] | 9 | 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...] |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 10 | |
| 11 | .SH DESCRIPTION |
| 12 | |
| 13 | HAProxy is a TCP/HTTP reverse proxy which is particularly suited for |
| 14 | high 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 | |
| 29 | It needs very little resource. Its event-driven architecture allows it |
| 30 | to easily handle thousands of simultaneous connections on hundreds of |
| 31 | instances without risking the system's stability. |
| 32 | |
| 33 | .SH OPTIONS |
| 34 | |
| 35 | .TP |
Maxime de Roucy | 379d9c7 | 2016-05-13 23:52:56 +0200 | [diff] [blame] | 36 | \fB\-f <configuration file|dir>\fP |
| 37 | Specify configuration file or directory path. If the argument is a directory |
Tim Düsterhus | 4896c44 | 2016-11-29 02:15:19 +0100 | [diff] [blame] | 38 | the files (and only files) it contains are added in lexical order (using |
Maxime de Roucy | e384139 | 2016-05-18 23:13:38 +0200 | [diff] [blame] | 39 | LC_COLLATE=C) ; only non hidden files with ".cfg" extension are added. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 40 | |
| 41 | .TP |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 42 | \fB\-L <name>\fP |
| 43 | Set the local instance's peer name. Peers are defined in the \fBpeers\fP |
| 44 | configuration section and used for syncing stick tables between different |
| 45 | instances. If this option is not specified, the local hostname is used as peer |
William Lallemand | c5473e5 | 2019-06-13 15:39:48 +0200 | [diff] [blame] | 46 | name. This name is exported in the $HAPROXY_LOCALPEER environment variable and |
| 47 | can be used in the configuration file. |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 48 | |
| 49 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 50 | \fB\-n <maxconn>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 51 | Set the high limit for the total number of simultaneous connections. |
| 52 | |
| 53 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 54 | \fB\-N <maxconn>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 55 | Set the high limit for the per-listener number of simultaneous connections. |
| 56 | |
| 57 | .TP |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 58 | \fB\-C <dir>\fP |
| 59 | Change directory to <\fIdir\fP> before loading any files. |
| 60 | |
| 61 | .TP |
| 62 | \fB\-v\fP |
| 63 | Display HAProxy's version. |
| 64 | |
| 65 | .TP |
| 66 | \fB\-vv\fP |
| 67 | Display HAProxy's version and all build options. |
| 68 | |
| 69 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 70 | \fB\-d\fP |
Jarno Huuskonen | 0e82b92 | 2014-04-12 18:22:19 +0300 | [diff] [blame] | 71 | Start in foreground with debugging mode enabled. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 72 | When the proxy runs in this mode, it dumps every connections, |
| 73 | disconnections, timestamps, and HTTP headers to stdout. This should |
| 74 | NEVER be used in an init script since it will prevent the system from |
| 75 | starting up. |
| 76 | |
| 77 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 78 | \fB\-D\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 79 | Start in daemon mode. |
| 80 | |
| 81 | .TP |
William Lallemand | 95635dd | 2019-06-13 11:51:09 +0200 | [diff] [blame] | 82 | \fB\-W\fP |
| 83 | Start in master-worker mode. Could be used either with foreground or daemon |
| 84 | mode. |
| 85 | |
| 86 | .TP |
| 87 | \fB\-Ws\fP |
| 88 | Start in master-worker mode with systemd notify support. It tells systemd when |
| 89 | the process is ready. This mode forces foreground. |
| 90 | |
| 91 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 92 | \fB\-q\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 93 | Disable messages on output. |
| 94 | |
| 95 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 96 | \fB\-V\fP |
| 97 | Displays messages on output even when \-q or 'quiet' are specified. Some |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 98 | information about pollers and config file are displayed during startup. |
| 99 | |
| 100 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 101 | \fB\-c\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 102 | Only checks config file and exits with code 0 if no error was found, or |
| 103 | exits with code 1 if a syntax error was found. |
| 104 | |
| 105 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 106 | \fB\-p <pidfile>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 107 | Ask the process to write down each of its children's pids to this file |
MIZUTA Takeshi | c32f394 | 2020-08-26 13:46:19 +0900 | [diff] [blame] | 108 | in daemon mode or ask the process to write down its master's pid to |
| 109 | this file in master-worker mode. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 110 | |
| 111 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 112 | \fB\-dk\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 113 | Disable use of \fBkqueue\fP(2). \fBkqueue\fP(2) is available only on BSD systems. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 114 | |
| 115 | .TP |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 116 | \fB\-dv\fP |
| 117 | Disable use of event ports. Event ports are available only on SunOS systems |
| 118 | derived from Solaris 10 and later (including illumos systems). |
| 119 | |
| 120 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 121 | \fB\-ds\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 122 | Disable use of speculative \fBepoll\fP(7). \fBepoll\fP(7) is available only on |
| 123 | Linux 2.6 and some custom Linux 2.4 systems. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 124 | |
| 125 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 126 | \fB\-de\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 127 | Disable use of \fBepoll\fP(7). \fBepoll\fP(7) is available only on Linux 2.6 |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 128 | and some custom Linux 2.4 systems. |
| 129 | |
| 130 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 131 | \fB\-dp\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 132 | Disables use of \fBpoll\fP(2). \fBselect\fP(2) might be used instead. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 133 | |
| 134 | .TP |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 135 | \fB\-dS\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 136 | Disables use of \fBsplice\fP(2), which is broken on older kernels. |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 137 | |
| 138 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 139 | \fB\-db\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 140 | Disables background mode (stays in foreground, useful for debugging). |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 141 | For debugging, the '\-db' option is very useful as it temporarily |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 142 | disables daemon mode and multi-process mode. The service can then be |
| 143 | stopped by simply pressing Ctrl-C, without having to edit the config nor |
| 144 | run full debug. |
| 145 | |
| 146 | .TP |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 147 | \fB\-dM[<byte>]\fP |
| 148 | Initializes all allocated memory areas with the given <\fIbyte\fP>. This makes |
| 149 | it easier to detect bugs resulting from uninitialized memory accesses, at the |
| 150 | expense of touching all allocated memory once. If <\fIbyte\fP> is not |
| 151 | specified, it defaults to 0x50 (ASCII 'P'). |
| 152 | |
| 153 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 154 | \fB\-m <megs>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 155 | Enforce a memory usage limit to a maximum of <megs> megabytes. |
| 156 | |
| 157 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 158 | \fB\-sf <pidlist>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 159 | Send FINISH signal to the pids in pidlist after startup. The processes |
| 160 | which receive this signal will wait for all sessions to finish before |
| 161 | exiting. This option must be specified last, followed by any number of |
| 162 | PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent. |
| 163 | |
| 164 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 165 | \fB\-st <pidlist>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 166 | Send TERMINATE signal to the pids in pidlist after startup. The processes |
Jorrit Schippers | 1458fdb | 2016-04-09 20:30:38 +0200 | [diff] [blame] | 167 | which receive this signal will terminate immediately, closing all active |
| 168 | sessions. This option must be specified last, followed by any number of |
| 169 | PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 170 | |
Olivier Houchard | d33fc3a | 2017-04-05 22:50:59 +0200 | [diff] [blame] | 171 | .TP |
| 172 | \f8\-x <unix_socket>\fP |
| 173 | Attempt to connect to the unix socket, and retrieve all the listening sockets |
| 174 | from the old process. Those sockets will then be used if possible instead of |
| 175 | binding new ones. |
| 176 | |
William Lallemand | 63329e3 | 2019-06-13 17:03:37 +0200 | [diff] [blame] | 177 | .TP |
| 178 | \fB\-S <bind>[,<bind options>...]\fP |
| 179 | In master-worker mode, create a master CLI. This CLI will enable access to the |
| 180 | CLI of every worker. Useful for debugging, it's a convenient way of accessing a |
| 181 | leaving process. |
| 182 | |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 183 | .SH LOGGING |
| 184 | Since HAProxy can run inside a chroot, it cannot reliably access /dev/log. |
| 185 | For this reason, it uses the UDP protocol to send its logs to the server, |
| 186 | even if it is the local server. People who experience trouble receiving |
| 187 | logs should ensure that their syslog daemon listens to the UDP socket. |
| 188 | Several Linux distributions which ship with syslogd from the sysklogd |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 189 | package have UDP disabled by default. The \fB\-r\fP option must be passed |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 190 | to the daemon in order to enable UDP. |
| 191 | |
| 192 | .SH SIGNALS |
| 193 | Some 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 Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 195 | \- \fBSIGUSR1\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 196 | Tells 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 Lallemand | 95635dd | 2019-06-13 11:51:09 +0200 | [diff] [blame] | 198 | \- \fBSIGUSR2\fP |
| 199 | In master-worker mode, reloads the configuration and sends a soft-stop signal to old processes. |
| 200 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 201 | \- \fBSIGTTOU\fP |
| 202 | Tells the daemon to stop listening to all sockets. Used internally by \fB\-sf\fP and \fB\-st\fP. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 203 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 204 | \- \fBSIGTTIN\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 205 | Tells 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 Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 207 | \- \fBSIGINT\fP and \fBSIGTERM\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 208 | Both signals can be used to quickly stop the daemon. |
| 209 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 210 | \- \fBSIGHUP\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 211 | Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes. |
| 212 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 213 | \- \fBSIGQUIT\fP |
Willy Tarreau | d153b3b | 2014-01-25 18:19:32 +0100 | [diff] [blame] | 214 | Dumps information about memory pools on stderr. Mostly used for debugging purposes. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 215 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 216 | \- \fBSIGPIPE\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 217 | This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP. |
| 218 | |
| 219 | .SH SEE ALSO |
| 220 | |
Apollon Oikonomopoulos | 2e97957 | 2013-09-29 23:04:13 +0300 | [diff] [blame] | 221 | A much better documentation can be found in configuration.txt. On Debian |
| 222 | systems, you can find this file in /usr/share/doc/haproxy/configuration.txt.gz. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 223 | |
| 224 | .SH AUTHOR |
| 225 | |
| 226 | HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau. |
| 227 | |