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 | |
Maxime de Roucy | 379d9c7 | 2016-05-13 23:52:56 +0200 | [diff] [blame] | 9 | haproxy \-f <configuration\ file|dir> [\-L\ <name>] [\-n\ maxconn] [\-N\ maxconn] [\-C\ <dir>] [\-v|\-vv] [\-d] [\-D] [\-q] [\-V] [\-c] [\-p\ <pidfile>] [\-dk] [\-ds] [\-de] [\-dp] [\-db] [\-dM[<byte>]] [\-m\ <megs>] [{\-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 |
Maxime de Roucy | e384139 | 2016-05-18 23:13:38 +0200 | [diff] [blame] | 38 | the files (and only files) it containes are added in lexical order (using |
| 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 |
| 46 | name. |
| 47 | |
| 48 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 49 | \fB\-n <maxconn>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 50 | Set the high limit for the total number of simultaneous connections. |
| 51 | |
| 52 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 53 | \fB\-N <maxconn>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 54 | Set the high limit for the per-listener number of simultaneous connections. |
| 55 | |
| 56 | .TP |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 57 | \fB\-C <dir>\fP |
| 58 | Change directory to <\fIdir\fP> before loading any files. |
| 59 | |
| 60 | .TP |
| 61 | \fB\-v\fP |
| 62 | Display HAProxy's version. |
| 63 | |
| 64 | .TP |
| 65 | \fB\-vv\fP |
| 66 | Display HAProxy's version and all build options. |
| 67 | |
| 68 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 69 | \fB\-d\fP |
Jarno Huuskonen | 0e82b92 | 2014-04-12 18:22:19 +0300 | [diff] [blame] | 70 | Start in foreground with debugging mode enabled. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 71 | When the proxy runs in this mode, it dumps every connections, |
| 72 | disconnections, timestamps, and HTTP headers to stdout. This should |
| 73 | NEVER be used in an init script since it will prevent the system from |
| 74 | starting up. |
| 75 | |
| 76 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 77 | \fB\-D\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 78 | Start in daemon mode. |
| 79 | |
| 80 | .TP |
Marc-Antoine Perennou | 992709b | 2013-02-12 10:53:52 +0100 | [diff] [blame] | 81 | \fB\-Ds\fP |
| 82 | Start in systemd daemon mode, keeping a process in foreground. |
| 83 | |
| 84 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 85 | \fB\-q\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 86 | Disable messages on output. |
| 87 | |
| 88 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 89 | \fB\-V\fP |
| 90 | Displays messages on output even when \-q or 'quiet' are specified. Some |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 91 | information about pollers and config file are displayed during startup. |
| 92 | |
| 93 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 94 | \fB\-c\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 95 | Only checks config file and exits with code 0 if no error was found, or |
| 96 | exits with code 1 if a syntax error was found. |
| 97 | |
| 98 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 99 | \fB\-p <pidfile>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 100 | Ask the process to write down each of its children's pids to this file |
| 101 | in daemon mode. |
| 102 | |
| 103 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 104 | \fB\-dk\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 105 | 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] | 106 | |
| 107 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 108 | \fB\-ds\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 109 | Disable use of speculative \fBepoll\fP(7). \fBepoll\fP(7) is available only on |
| 110 | Linux 2.6 and some custom Linux 2.4 systems. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 111 | |
| 112 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 113 | \fB\-de\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 114 | 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] | 115 | and some custom Linux 2.4 systems. |
| 116 | |
| 117 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 118 | \fB\-dp\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 119 | 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] | 120 | |
| 121 | .TP |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 122 | \fB\-dS\fP |
Apollon Oikonomopoulos | 7ef0edf | 2013-09-29 23:03:51 +0300 | [diff] [blame] | 123 | Disables use of \fBsplice\fP(2), which is broken on older kernels. |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 124 | |
| 125 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 126 | \fB\-db\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 127 | Disables background mode (stays in foreground, useful for debugging). |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 128 | For debugging, the '\-db' option is very useful as it temporarily |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 129 | disables daemon mode and multi-process mode. The service can then be |
| 130 | stopped by simply pressing Ctrl-C, without having to edit the config nor |
| 131 | run full debug. |
| 132 | |
| 133 | .TP |
Apollon Oikonomopoulos | 6712bb7 | 2013-09-29 23:03:37 +0300 | [diff] [blame] | 134 | \fB\-dM[<byte>]\fP |
| 135 | Initializes all allocated memory areas with the given <\fIbyte\fP>. This makes |
| 136 | it easier to detect bugs resulting from uninitialized memory accesses, at the |
| 137 | expense of touching all allocated memory once. If <\fIbyte\fP> is not |
| 138 | specified, it defaults to 0x50 (ASCII 'P'). |
| 139 | |
| 140 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 141 | \fB\-m <megs>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 142 | Enforce a memory usage limit to a maximum of <megs> megabytes. |
| 143 | |
| 144 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 145 | \fB\-sf <pidlist>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 146 | Send FINISH signal to the pids in pidlist after startup. The processes |
| 147 | which receive this signal will wait for all sessions to finish before |
| 148 | exiting. This option must be specified last, followed by any number of |
| 149 | PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent. |
| 150 | |
| 151 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 152 | \fB\-st <pidlist>\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 153 | Send TERMINATE signal to the pids in pidlist after startup. The processes |
Jorrit Schippers | 1458fdb | 2016-04-09 20:30:38 +0200 | [diff] [blame] | 154 | which receive this signal will terminate immediately, closing all active |
| 155 | sessions. This option must be specified last, followed by any number of |
| 156 | PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 157 | |
| 158 | .SH LOGGING |
| 159 | Since HAProxy can run inside a chroot, it cannot reliably access /dev/log. |
| 160 | For this reason, it uses the UDP protocol to send its logs to the server, |
| 161 | even if it is the local server. People who experience trouble receiving |
| 162 | logs should ensure that their syslog daemon listens to the UDP socket. |
| 163 | Several Linux distributions which ship with syslogd from the sysklogd |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 164 | 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] | 165 | to the daemon in order to enable UDP. |
| 166 | |
| 167 | .SH SIGNALS |
| 168 | Some signals have a special meaning for the haproxy daemon. Generally, they are used between daemons and need not be used by the administrator. |
| 169 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 170 | \- \fBSIGUSR1\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 171 | Tells the daemon to stop all proxies and exit once all sessions are closed. It is often referred to as the "soft-stop" signal. |
| 172 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 173 | \- \fBSIGTTOU\fP |
| 174 | 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] | 175 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 176 | \- \fBSIGTTIN\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 177 | Tells the daemon to restart listening to all sockets after a \fBSIGTTOU\fP. Used internally when there was a problem during hot reconfiguration. |
| 178 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 179 | \- \fBSIGINT\fP and \fBSIGTERM\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 180 | Both signals can be used to quickly stop the daemon. |
| 181 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 182 | \- \fBSIGHUP\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 183 | Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes. |
| 184 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 185 | \- \fBSIGQUIT\fP |
Willy Tarreau | d153b3b | 2014-01-25 18:19:32 +0100 | [diff] [blame] | 186 | Dumps information about memory pools on stderr. Mostly used for debugging purposes. |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 187 | .TP |
Michael Shuler | 35928e8 | 2009-10-14 10:23:03 -0500 | [diff] [blame] | 188 | \- \fBSIGPIPE\fP |
Willy Tarreau | 031a26b | 2007-09-09 22:40:07 +0200 | [diff] [blame] | 189 | This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP. |
| 190 | |
| 191 | .SH SEE ALSO |
| 192 | |
Apollon Oikonomopoulos | 2e97957 | 2013-09-29 23:04:13 +0300 | [diff] [blame] | 193 | A much better documentation can be found in configuration.txt. On Debian |
| 194 | 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] | 195 | |
| 196 | .SH AUTHOR |
| 197 | |
| 198 | HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau. |
| 199 | |