2007-09-09 20:40:07 +00:00
|
|
|
.TH HAPROXY 1 "17 August 2007"
|
|
|
|
|
|
|
|
.SH NAME
|
|
|
|
|
|
|
|
HAProxy \- fast and reliable http reverse proxy and load balancer
|
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
2017-04-05 20:50:59 +00:00
|
|
|
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>] [\-x <unix_socket>] [{\-sf|\-st}\ pidlist...]
|
2007-09-09 20:40:07 +00:00
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
|
|
|
HAProxy is a TCP/HTTP reverse proxy which is particularly suited for
|
|
|
|
high availability environments. Indeed, it can:
|
|
|
|
\- route HTTP requests depending on statically assigned cookies ;
|
|
|
|
\- spread the load among several servers while assuring server
|
|
|
|
persistence through the use of HTTP cookies ;
|
|
|
|
\- switch to backup servers in the event a main one fails ;
|
|
|
|
\- accept connections to special ports dedicated to service
|
|
|
|
monitoring ;
|
|
|
|
\- stop accepting connections without breaking existing ones ;
|
|
|
|
\- add/modify/delete HTTP headers both ways ;
|
|
|
|
\- block requests matching a particular pattern ;
|
|
|
|
\- hold clients to the right application server depending on
|
|
|
|
application cookies
|
|
|
|
\- report detailed status as HTML pages to authenticated users from an
|
|
|
|
URI intercepted from the application.
|
|
|
|
|
|
|
|
It needs very little resource. Its event-driven architecture allows it
|
|
|
|
to easily handle thousands of simultaneous connections on hundreds of
|
|
|
|
instances without risking the system's stability.
|
|
|
|
|
|
|
|
.SH OPTIONS
|
|
|
|
|
|
|
|
.TP
|
2016-05-13 21:52:56 +00:00
|
|
|
\fB\-f <configuration file|dir>\fP
|
|
|
|
Specify configuration file or directory path. If the argument is a directory
|
2016-11-29 01:15:19 +00:00
|
|
|
the files (and only files) it contains are added in lexical order (using
|
2016-05-18 21:13:38 +00:00
|
|
|
LC_COLLATE=C) ; only non hidden files with ".cfg" extension are added.
|
2007-09-09 20:40:07 +00:00
|
|
|
|
2013-09-29 20:03:37 +00:00
|
|
|
.TP
|
|
|
|
\fB\-L <name>\fP
|
|
|
|
Set the local instance's peer name. Peers are defined in the \fBpeers\fP
|
|
|
|
configuration section and used for syncing stick tables between different
|
|
|
|
instances. If this option is not specified, the local hostname is used as peer
|
|
|
|
name.
|
|
|
|
|
2007-09-09 20:40:07 +00:00
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-n <maxconn>\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Set the high limit for the total number of simultaneous connections.
|
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-N <maxconn>\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Set the high limit for the per-listener number of simultaneous connections.
|
|
|
|
|
2013-09-29 20:03:37 +00:00
|
|
|
.TP
|
|
|
|
\fB\-C <dir>\fP
|
|
|
|
Change directory to <\fIdir\fP> before loading any files.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fB\-v\fP
|
|
|
|
Display HAProxy's version.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fB\-vv\fP
|
|
|
|
Display HAProxy's version and all build options.
|
|
|
|
|
2007-09-09 20:40:07 +00:00
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-d\fP
|
2014-04-12 15:22:19 +00:00
|
|
|
Start in foreground with debugging mode enabled.
|
2007-09-09 20:40:07 +00:00
|
|
|
When the proxy runs in this mode, it dumps every connections,
|
|
|
|
disconnections, timestamps, and HTTP headers to stdout. This should
|
|
|
|
NEVER be used in an init script since it will prevent the system from
|
|
|
|
starting up.
|
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-D\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Start in daemon mode.
|
|
|
|
|
2013-02-12 09:53:52 +00:00
|
|
|
.TP
|
|
|
|
\fB\-Ds\fP
|
|
|
|
Start in systemd daemon mode, keeping a process in foreground.
|
|
|
|
|
2007-09-09 20:40:07 +00:00
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-q\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Disable messages on output.
|
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-V\fP
|
|
|
|
Displays messages on output even when \-q or 'quiet' are specified. Some
|
2007-09-09 20:40:07 +00:00
|
|
|
information about pollers and config file are displayed during startup.
|
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-c\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Only checks config file and exits with code 0 if no error was found, or
|
|
|
|
exits with code 1 if a syntax error was found.
|
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-p <pidfile>\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Ask the process to write down each of its children's pids to this file
|
|
|
|
in daemon mode.
|
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-dk\fP
|
2013-09-29 20:03:51 +00:00
|
|
|
Disable use of \fBkqueue\fP(2). \fBkqueue\fP(2) is available only on BSD systems.
|
2007-09-09 20:40:07 +00:00
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-ds\fP
|
2013-09-29 20:03:51 +00:00
|
|
|
Disable use of speculative \fBepoll\fP(7). \fBepoll\fP(7) is available only on
|
|
|
|
Linux 2.6 and some custom Linux 2.4 systems.
|
2007-09-09 20:40:07 +00:00
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-de\fP
|
2013-09-29 20:03:51 +00:00
|
|
|
Disable use of \fBepoll\fP(7). \fBepoll\fP(7) is available only on Linux 2.6
|
2007-09-09 20:40:07 +00:00
|
|
|
and some custom Linux 2.4 systems.
|
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-dp\fP
|
2013-09-29 20:03:51 +00:00
|
|
|
Disables use of \fBpoll\fP(2). \fBselect\fP(2) might be used instead.
|
2007-09-09 20:40:07 +00:00
|
|
|
|
2013-09-29 20:03:37 +00:00
|
|
|
.TP
|
|
|
|
\fB\-dS\fP
|
2013-09-29 20:03:51 +00:00
|
|
|
Disables use of \fBsplice\fP(2), which is broken on older kernels.
|
2013-09-29 20:03:37 +00:00
|
|
|
|
2007-09-09 20:40:07 +00:00
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-db\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Disables background mode (stays in foreground, useful for debugging).
|
2009-10-14 15:23:03 +00:00
|
|
|
For debugging, the '\-db' option is very useful as it temporarily
|
2007-09-09 20:40:07 +00:00
|
|
|
disables daemon mode and multi-process mode. The service can then be
|
|
|
|
stopped by simply pressing Ctrl-C, without having to edit the config nor
|
|
|
|
run full debug.
|
|
|
|
|
2013-09-29 20:03:37 +00:00
|
|
|
.TP
|
|
|
|
\fB\-dM[<byte>]\fP
|
|
|
|
Initializes all allocated memory areas with the given <\fIbyte\fP>. This makes
|
|
|
|
it easier to detect bugs resulting from uninitialized memory accesses, at the
|
|
|
|
expense of touching all allocated memory once. If <\fIbyte\fP> is not
|
|
|
|
specified, it defaults to 0x50 (ASCII 'P').
|
|
|
|
|
2007-09-09 20:40:07 +00:00
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-m <megs>\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Enforce a memory usage limit to a maximum of <megs> megabytes.
|
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-sf <pidlist>\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Send FINISH signal to the pids in pidlist after startup. The processes
|
|
|
|
which receive this signal will wait for all sessions to finish before
|
|
|
|
exiting. This option must be specified last, followed by any number of
|
|
|
|
PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent.
|
|
|
|
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\fB\-st <pidlist>\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Send TERMINATE signal to the pids in pidlist after startup. The processes
|
2016-04-09 18:30:38 +00:00
|
|
|
which receive this signal will terminate immediately, closing all active
|
|
|
|
sessions. This option must be specified last, followed by any number of
|
|
|
|
PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent.
|
2007-09-09 20:40:07 +00:00
|
|
|
|
2017-04-05 20:50:59 +00:00
|
|
|
.TP
|
|
|
|
\f8\-x <unix_socket>\fP
|
|
|
|
Attempt to connect to the unix socket, and retrieve all the listening sockets
|
|
|
|
from the old process. Those sockets will then be used if possible instead of
|
|
|
|
binding new ones.
|
|
|
|
|
2007-09-09 20:40:07 +00:00
|
|
|
.SH LOGGING
|
|
|
|
Since HAProxy can run inside a chroot, it cannot reliably access /dev/log.
|
|
|
|
For this reason, it uses the UDP protocol to send its logs to the server,
|
|
|
|
even if it is the local server. People who experience trouble receiving
|
|
|
|
logs should ensure that their syslog daemon listens to the UDP socket.
|
|
|
|
Several Linux distributions which ship with syslogd from the sysklogd
|
2009-10-14 15:23:03 +00:00
|
|
|
package have UDP disabled by default. The \fB\-r\fP option must be passed
|
2007-09-09 20:40:07 +00:00
|
|
|
to the daemon in order to enable UDP.
|
|
|
|
|
|
|
|
.SH SIGNALS
|
|
|
|
Some signals have a special meaning for the haproxy daemon. Generally, they are used between daemons and need not be used by the administrator.
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\- \fBSIGUSR1\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Tells the daemon to stop all proxies and exit once all sessions are closed. It is often referred to as the "soft-stop" signal.
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\- \fBSIGTTOU\fP
|
|
|
|
Tells the daemon to stop listening to all sockets. Used internally by \fB\-sf\fP and \fB\-st\fP.
|
2007-09-09 20:40:07 +00:00
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\- \fBSIGTTIN\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Tells the daemon to restart listening to all sockets after a \fBSIGTTOU\fP. Used internally when there was a problem during hot reconfiguration.
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\- \fBSIGINT\fP and \fBSIGTERM\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Both signals can be used to quickly stop the daemon.
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\- \fBSIGHUP\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
Dumps the status of all proxies and servers into the logs. Mostly used for trouble-shooting purposes.
|
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\- \fBSIGQUIT\fP
|
2014-01-25 17:19:32 +00:00
|
|
|
Dumps information about memory pools on stderr. Mostly used for debugging purposes.
|
2007-09-09 20:40:07 +00:00
|
|
|
.TP
|
2009-10-14 15:23:03 +00:00
|
|
|
\- \fBSIGPIPE\fP
|
2007-09-09 20:40:07 +00:00
|
|
|
This signal is intercepted and ignored on systems without \fBMSG_NOSIGNAL\fP.
|
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
|
2013-09-29 20:04:13 +00:00
|
|
|
A much better documentation can be found in configuration.txt. On Debian
|
|
|
|
systems, you can find this file in /usr/share/doc/haproxy/configuration.txt.gz.
|
2007-09-09 20:40:07 +00:00
|
|
|
|
|
|
|
.SH AUTHOR
|
|
|
|
|
|
|
|
HAProxy was written by Willy Tarreau. This man page was written by Arnaud Cornet and Willy Tarreau.
|
|
|
|
|