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 |
| 108 | in daemon mode. |
| 109 | |
| 110 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 111 | \fB\-dk\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 112 | 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] | 113 | |
| 114 | .TP |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 115 | \fB\-dv\fP |
| 116 | Disable use of event ports. Event ports are available only on SunOS systems |
| 117 | derived from Solaris 10 and later (including illumos systems). |
| 118 | |
| 119 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 120 | \fB\-ds\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 121 | Disable use of speculative \fBepoll\fP(7). \fBepoll\fP(7) is available only on |
| 122 | Linux 2.6 and some custom Linux 2.4 systems. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 123 | |
| 124 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 125 | \fB\-de\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 126 | 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] | 127 | and some custom Linux 2.4 systems. |
| 128 | |
| 129 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 130 | \fB\-dp\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 131 | 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] | 132 | |
| 133 | .TP |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 134 | \fB\-dS\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 135 | Disables use of \fBsplice\fP(2), which is broken on older kernels. |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 136 | |
| 137 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 138 | \fB\-db\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 139 | Disables background mode (stays in foreground, useful for debugging). |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 140 | For debugging, the '\-db' option is very useful as it temporarily |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 141 | disables daemon mode and multi-process mode. The service can then be |
| 142 | stopped by simply pressing Ctrl-C, without having to edit the config nor |
| 143 | run full debug. |
| 144 | |
| 145 | .TP |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 146 | \fB\-dM[<byte>]\fP |
| 147 | Initializes all allocated memory areas with the given <\fIbyte\fP>. This makes |
| 148 | it easier to detect bugs resulting from uninitialized memory accesses, at the |
| 149 | expense of touching all allocated memory once. If <\fIbyte\fP> is not |
| 150 | specified, it defaults to 0x50 (ASCII 'P'). |
| 151 | |
| 152 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 153 | \fB\-m <megs>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 154 | Enforce a memory usage limit to a maximum of <megs> megabytes. |
| 155 | |
| 156 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 157 | \fB\-sf <pidlist>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 158 | Send FINISH signal to the pids in pidlist after startup. The processes |
| 159 | which receive this signal will wait for all sessions to finish before |
| 160 | exiting. This option must be specified last, followed by any number of |
| 161 | PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent. |
| 162 | |
| 163 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 164 | \fB\-st <pidlist>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 165 | Send TERMINATE signal to the pids in pidlist after startup. The processes |
Jorrit Schippers | 1458fdb | 2016-04-09 20:30:38 +0200 | [diff] [blame] | 166 | which receive this signal will terminate immediately, closing all active |
| 167 | sessions. This option must be specified last, followed by any number of |
| 168 | PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 169 | |
Olivier Houchard | d33fc3a | 2017-04-05 22:50:59 +0200 | [diff] [blame] | 170 | .TP |
| 171 | \f8\-x <unix_socket>\fP |
| 172 | Attempt to connect to the unix socket, and retrieve all the listening sockets |
| 173 | from the old process. Those sockets will then be used if possible instead of |
| 174 | binding new ones. |
| 175 | |
William Lallemand | 63329e3 | 2019-06-13 17:03:37 +0200 | [diff] [blame] | 176 | .TP |
| 177 | \fB\-S <bind>[,<bind options>...]\fP |
| 178 | In master-worker mode, create a master CLI. This CLI will enable access to the |
| 179 | CLI of every worker. Useful for debugging, it's a convenient way of accessing a |
| 180 | leaving process. |
| 181 | |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 182 | .SH LOGGING |
| 183 | Since HAProxy can run inside a chroot, it cannot reliably access /dev/log. |
| 184 | For this reason, it uses the UDP protocol to send its logs to the server, |
| 185 | even if it is the local server. People who experience trouble receiving |
| 186 | logs should ensure that their syslog daemon listens to the UDP socket. |
| 187 | Several Linux distributions which ship with syslogd from the sysklogd |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 188 | 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] | 189 | to the daemon in order to enable UDP. |
| 190 | |
| 191 | .SH SIGNALS |
| 192 | Some 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 Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 194 | \- \fBSIGUSR1\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 195 | Tells 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 Lallemand | 95635dd | 2019-06-13 11:51:09 +0200 | [diff] [blame] | 197 | \- \fBSIGUSR2\fP |
| 198 | In master-worker mode, reloads the configuration and sends a soft-stop signal to old processes. |
| 199 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 200 | \- \fBSIGTTOU\fP |
| 201 | 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] | 202 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 203 | \- \fBSIGTTIN\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 204 | Tells 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 Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 206 | \- \fBSIGINT\fP and \fBSIGTERM\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 207 | Both signals can be used to quickly stop the daemon. |
| 208 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 209 | \- \fBSIGHUP\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 210 | Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes. |
| 211 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 212 | \- \fBSIGQUIT\fP |
Willy Tarreau | d153b3b | 2014-01-25 18:19:32 +0100 | [diff] [blame] | 213 | Dumps information about memory pools on stderr. Mostly used for debugging purposes. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 214 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 215 | \- \fBSIGPIPE\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 216 | This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP. |
| 217 | |
| 218 | .SH SEE ALSO |
| 219 | |
Apollon Oikonomopoulos | 2e97957 | 2013-09-29 23:04:13 +0300 | [diff] [blame] | 220 | A much better documentation can be found in configuration.txt. On Debian |
| 221 | 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] | 222 | |
| 223 | .SH AUTHOR |
| 224 | |
| 225 | HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau. |
| 226 | |