HAProxy Version 1.7-Dev1 - Configuration Manual

download HAProxy Version 1.7-Dev1 - Configuration Manual

of 65

Transcript of HAProxy Version 1.7-Dev1 - Configuration Manual

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    1/171

    gle navigation  HAProxy Configuration Manual

    HAProxy home pageVersions

    HAProxy 1.4Configuration Manual (stable)

    Configuration Manual (snapshot)GIT RepositoryBrowse repositoryBrowse directory

    HAProxy 1.5Configuration Manual (stable)

    Configuration Manual (snapshot)

    GIT RepositoryBrowse repositoryBrowse directory

    HAProxy 1.6Configuration Manual (stable)

    Configuration Manual (snapshot)

    Starter Guide (stable)Starter Guide (snapshot)GIT RepositoryBrowse repositoryBrowse directory

    ch...

    board navigation :

    n enabled, you can use left and right arrow keys to navigate between chapters.feature is automatically disabled when the search field is focused.

    erted with haproxy-dconv v0.3.1-39 on 2015/12/21

    AProxy

    nfiguration Manual

    ion 1.7-dev1

    y tarreau/12/20

    document covers the configuration language as implemented in the versionified above. It does not provide any hint, example or advice. For suchmentation, please refer to the Reference Manual or the Architecture Manual.summary below is meant to help you search sections by name and navigateugh the document.

    to documentation contributors :This document is formatted with 80 columns per line, with even number ofspaces for indentation and without tabs. Please follow these rules strictlyso that it remains easily printable everywhere. If a line needs to beprinted verbatim and does not fit, please end each line with a backslash('\') and continue on next line, indented by two characters. It is alsosometimes useful to prefix all output lines (logs, console outs) with 3closing angle brackets ('>>>') in order to help get the difference betweeninputs and outputs when it can become ambiguous. If you add sections,

    please update the summ ary below for easier searching.

    ummary

    Quick reminder about HTTP

    The HTTP transaction model

    HTTP request

    . The Request line

    . The request headers

    HTTP response

    . The Response line

    . The response headers

    Configuring HAProxy

    Configuration file format

    Quoting and escaping

    Environment variables

    Time format

    Examples

    Global parameters

    http://users/felipewd/bla.html#2.5http://users/felipewd/bla.html#2.4http://users/felipewd/bla.html#2.3http://users/felipewd/bla.html#2.2http://users/felipewd/bla.html#2.1http://users/felipewd/bla.html#2.1http://users/felipewd/bla.html#2http://users/felipewd/bla.html#1.3.1http://users/felipewd/bla.html#1.3http://users/felipewd/bla.html#1.2.2http://users/felipewd/bla.html#1.2.1http://users/felipewd/bla.html#1.2http://users/felipewd/bla.html#1http://users/felipewd/bla.html#1http://users/felipewd/bla.html#1https://github.com/cbonte/haproxy-dconvhttp://www.haproxy.org/download/1.6/http://www.haproxy.org/git/?p=haproxy.githttp://users/felipewd/intro-1.6.htmlhttp://www.haproxy.org/download/1.5/http://www.haproxy.org/git/?p=haproxy-1.5.githttp://git.1wt.eu/git/haproxy-1.5.git/http://users/felipewd/configuration-1.5.htmlhttp://www.haproxy.org/git/?p=haproxy-1.4.githttp://users/felipewd/snapshot/configuration-1.4.htmlhttp://users/felipewd/configuration-1.4.htmlhttp://users/felipewd/bla.html#http://www.haproxy.org/http://users/felipewd/bla.html#3http://users/felipewd/bla.html#2.5http://users/felipewd/bla.html#2.4http://users/felipewd/bla.html#2.3http://users/felipewd/bla.html#2.2http://users/felipewd/bla.html#2.1http://users/felipewd/bla.html#2http://users/felipewd/bla.html#1.3.2http://users/felipewd/bla.html#1.3.1http://users/felipewd/bla.html#1.3http://users/felipewd/bla.html#1.2.2http://users/felipewd/bla.html#1.2.1http://users/felipewd/bla.html#1.2http://users/felipewd/bla.html#1.1http://users/felipewd/bla.html#1https://github.com/cbonte/haproxy-dconvhttp://www.haproxy.org/download/1.6/http://www.haproxy.org/git/?p=haproxy.githttp://git.1wt.eu/git/haproxy.git/http://users/felipewd/snapshot/intro-1.6.htmlhttp://users/felipewd/intro-1.6.htmlhttp://users/felipewd/snapshot/configuration-1.6.htmlhttp://users/felipewd/configuration-1.6.htmlhttp://www.haproxy.org/download/1.5/http://www.haproxy.org/git/?p=haproxy-1.5.githttp://git.1wt.eu/git/haproxy-1.5.git/http://users/felipewd/snapshot/configuration-1.5.htmlhttp://users/felipewd/configuration-1.5.htmlhttp://www.haproxy.org/download/1.4/http://www.haproxy.org/git/?p=haproxy-1.4.githttp://git.1wt.eu/git/haproxy-1.4.git/http://users/felipewd/snapshot/configuration-1.4.htmlhttp://users/felipewd/configuration-1.4.htmlhttp://users/felipewd/bla.html#http://www.haproxy.org/http://users/felipewd/index.html

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    2/171

    Process management and security

    Performance tuning

    Debugging

    Userlists

    Peers

    Mailers

    Proxies

    Proxy keywords matrix

    Alphabetically sorted keywords reference

    Bind and Server options

    Bind options

    Server and default-server options

    Server DNS resolution

    . Global overview

    . The resolvers section

    HTTP header manipulation

    Using ACLs and fetching samples

    ACL basics

    . Matching booleans

    . Matching integers

    . Matching strings

    . Matching regular expressions (regexes)

    . Matching arbitrary data blocks

    . Matching IPv4 and IPv6 addresses

    Using ACLs to form conditions

    Fetching samples

    . Converters

    . Fetching samples from internal states

    . Fetching samples at Layer 4

    . Fetching samples at Layer 5

    . Fetching samples from buffer contents (Layer 6)

    . Fetching HTTP samples (Layer 7)

    Pre-defined ACLs

    Logging

    Log levels

    Log formats

    . Default log format

    . TCP log format

    . HTTP log format

    . Custom log format

    . Error log format

    Advanced logging options

    . Disabling logging of external tests

    . Logging before waiting for the session to terminate

    . Raising log level upon errors

    . Disabling logging of successful connections

    Timing eventsSession state at disconnection

    Non-printable characters

    Capturing HTTP cookies

    Capturing HTTP headers

    Examples of logs

    Quick reminder about HTTP

    n haproxy is running in HTTP mode, both the request and the response arey analyzed and indexed, thus it becomes possible to build matching criterialmost anything found in the contents.

    ver, it is important to understand how HTTP requests and responses are

    med, and how HAProxy decomposes them. It will then become easier to writeect rules and to debug existing configurations.

    The HTTP transaction model

    HTTP protocol is transaction-driven. This means that each request will leadne and only one response. Traditionally, a TCP connection is establishedm the client to the server, a request is sent by the client on thenection, the server responds and the connection is closed. A new request involve a new connection :

    http://users/felipewd/bla.html#8.9http://users/felipewd/bla.html#8.8http://users/felipewd/bla.html#8.7http://users/felipewd/bla.html#8.6http://users/felipewd/bla.html#8.5http://users/felipewd/bla.html#8.4http://users/felipewd/bla.html#8.3.4http://users/felipewd/bla.html#8.3.3http://users/felipewd/bla.html#8.3.2http://users/felipewd/bla.html#8.3.1http://users/felipewd/bla.html#8.3http://users/felipewd/bla.html#8.2.5http://users/felipewd/bla.html#8.2.4http://users/felipewd/bla.html#8.2.3http://users/felipewd/bla.html#8.2.2http://users/felipewd/bla.html#8.2.1http://users/felipewd/bla.html#8.2http://users/felipewd/bla.html#8.1http://users/felipewd/bla.html#8http://users/felipewd/bla.html#7.4http://users/felipewd/bla.html#7.3.6http://users/felipewd/bla.html#7.3.5http://users/felipewd/bla.html#7.3.4http://users/felipewd/bla.html#7.3.3http://users/felipewd/bla.html#7.3.2http://users/felipewd/bla.html#7.3.1http://users/felipewd/bla.html#7.3http://users/felipewd/bla.html#7.2http://users/felipewd/bla.html#7.1.6http://users/felipewd/bla.html#7.1.5http://users/felipewd/bla.html#7.1.4http://users/felipewd/bla.html#7.1.3http://users/felipewd/bla.html#7.1.2http://users/felipewd/bla.html#7.1.1http://users/felipewd/bla.html#7.1http://users/felipewd/bla.html#7http://users/felipewd/bla.html#6http://users/felipewd/bla.html#5.3.2http://users/felipewd/bla.html#5.3.1http://users/felipewd/bla.html#5.3http://users/felipewd/bla.html#5.2http://users/felipewd/bla.html#5.1http://users/felipewd/bla.html#5http://users/felipewd/bla.html#4.2http://users/felipewd/bla.html#4.1http://users/felipewd/bla.html#4http://users/felipewd/bla.html#3.6http://users/felipewd/bla.html#3.5http://users/felipewd/bla.html#3.4http://users/felipewd/bla.html#3.3http://users/felipewd/bla.html#3.2http://users/felipewd/bla.html#3.1

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    3/171

    ON1] [REQ1] ... [RESP1] [CLO1] [CON2] [REQ2] ... [RESP2] [CLO2] ...

    his mode, called the "HTTP close" mode, there are as many connectionablishments as there are HTTP transactions. Since the connection is closedhe server after the response, the client does not need to know the contentgth.

    to the transactional nature of the protocol, it was possible to improve itavoid closing a connection between two subsequent transactions. In this modever, it is mandatory that the server indicates the content length for eachponse so that the client does not wait indefinitely. For this, a specialder is used: "Content-length". This mode is called the "keep-alive" mode :

    ON] [REQ1] ... [RESP1] [REQ2] ... [RESP2] [CLO] ...

    advantages are a reduced latency between transactions, and less processingr required on the server side. It is generally better than the close mode,

    not always because the clients often limit their concurrent connections toaller value.

    ast improvement in the communications is the pipelining mode. It still usesp-alive, but the client does not wait for the first response to send thend request. This is useful for fetching large number of images composing a :

    ON] [REQ1] [REQ2] ... [RESP1] [RESP2] [CLO] ...

    can obviously have a tremendous benefit on performance because the networkncy is eliminated between subsequent requests. Many HTTP agents do notectly support pipelining since there is no way to associate a response withcorresponding request in HTTP. For this reason, it is mandatory for thever to reply in the exact same order as the requests were received.

    efault HAProxy operates in keep-alive mode with regards to persistentnections: for each connection it processes each request and response, andves the connection idle on both sides between the end of a response and thet of a new request.

    oxy supports 5 connection modes :keep alive : all requests and responses are processed (default)tunnel : only the first request and response are processed,

    everything else is forwarded with no analysis.passive close : tunnel with "Connection: close" added in both directions.server close : the server-facing connection is closed after the response.forced close : the connection is actively closed after end of response.

    HTTP request

    t, let's consider this HTTP request :

    ne Contentsmber1 GET /serv/login.php?lang=en&profile=2 HTTP/1.12 Host: www.mydomain.com 3 User-agent: my small browser4 Accept: image/jpeg, image/gif5 Accept: image/png

    1. The Request line

    1 is the "request line". It is always composed of 3 fields :

    a METHOD : GETa URI : /serv/login.php?lang=en&profile=2a version tag : HTTP/1.1

    of them are delimited by what the standard calls LWS (linear white spaces),h are commonly spaces, but can also be tabs or line feeds/carriage returnsowed by spaces/tabs. The method itself cannot contain any colon (':') andimited to alphabetic letters. All those various combinations make it

    rable that HAProxy performs the splitting itself rather than leaving it touser to write a complex or inaccurate regular expression.

    URI itself can have several forms :

    A "relative URI" :

    /serv/login.php?lang=en&profile=2

    It is a complete URL without the host part. This is generally what isreceived by servers, reverse proxies and transparent proxies.

    An "absolute URI", also called a "URL" :

    http://192.168.0.12:8080/serv/login.php?lang=en&profile=2

    It is composed of a "scheme" (the protocol name followed by '://'), a hostname or address, optionally a colon (':') followed by a port number, thena relative URI beginning at the first slash ('/') after the address part.

    This is generally what proxies receive, but a server supporting HTTP/1.1must accept this form too.

    a star ('*') : this form is only accepted in association with the OPTIONSmethod and is not relayable. It is used to inquiry a next hop'scapabilities.

    an address:port combination : 192.168.0.12:80This is used with the CONNECT method, which is used to establish TCPtunnels through HTTP proxies, generally for HTTPS, but sometimes forother protocols too.

    http://users/felipewd/bla.html#1.2.1

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    4/171

    relative URI, two sub-parts are identified. The part before the questionk is called the "path". It is typically the relative path to static objectshe server. The part after the question mark is called the "query string".s mostly used with GET requests sent to dynamic scripts and is veryific to the language, framework or application in use.

    2. The request headers

    headers start at the second line. They are composed of a name at thenning of the line, immediately followed by a colon (':'). Traditionally,WS is added after the colon but that's not required. Then come the values.iple identical headers may be folded into one single line, delimiting thees with commas, provided that their order is respected. This is commonlyuntered in the "Cookie:" field. A header may span over multiple lines ifsubsequent lines begin with an LWS. In the example in 1.2, lines 4 and 5ne a total of 3 values for the "Accept:" header.

    rary to a common mis-conception, header names are not case-sensitive, andr values are not either if they refer to other header names (such as thennection:" header).

    end of the headers is indicated by the first empty line. People often say it's a double line feed, which is not exact, even if a double line feedne valid form of empty line.

    unately, HAProxy takes care of all these complex combinations when indexingers, checking values and counting them, so there is no reason to worryt the way they could be written, but it is important not to accuse anication of being buggy if it does unusual, valid things.

    rtant note:As suggested by RFC2616, HAProxy normalizes headers by replacing line breaksn the middle of headers by LWS in order to join multi-line headers. Thiss necessary for proper analysis and helps less capable HTTP parsers to workorrectly and not to be fooled by such complex constructs.

    HTTP response

    TTP response looks very much like an HTTP request. Both are called HTTPages. Let's consider this HTTP response :

    ne Contentsmber1 HTTP/1.1 200 OK2 Content-length: 3503 Content-Type: text/html

    special case, HTTP supports so called "Informational responses" as statuss 1xx. These messages are special in that they don't convey any part of theponse, they're just used as sort of a signaling message to ask a client toinue to post its request for instance. In the case of a status 100 responserequested information will be carried by the next non-100 response message

    owing the informational one. This implies that multiple responses may be to a single request, and that this only works when keep-alive is enabled

    x messages are HTTP/1.1 only). HAProxy handles these messages and is able toectly forward and skip them, and only process the next non-100 response. As, these messages are neither logged nor transformed, unless explicitlye otherwise. Status 101 messages indicate that the protocol is changing the same connection and that haproxy must switch to tunnel mode, just asCONNECT had occurred. Then the Upgrade header would contain additionalrmation about the type of protocol the connection is switching to.

    1. The Response line

    1 is the "response line". It is always composed of 3 fields :

    a version tag : HTTP/1.1a status code : 200a reason : OK

    status code is always 3-digit. The first digit indicates a general status :xx = informational message to be skipped (eg: 100, 101)xx = OK, content is following (eg: 200, 206)xx = OK, no content following (eg: 302, 304)xx = error caused by the client (eg: 401, 403, 404)xx = error caused by the server (eg: 500, 502, 503)

    ase refer to RFC2616 for the detailed meaning of all such codes. Theson" field is just a hint, but is not parsed by clients. Anything can bend there, but it's a common practice to respect the well-establishedages. It can be composed of one or multiple words, such as "OK", "Found",Authentication Required".

    oxy may emit the following status codes by itself :

    de When / reason00 access to stats page, and when replying to monitoring requests01 when performing a redirection, depending on the configured code

    02 when performing a redirection, depending on the configured code03 when performing a redirection, depending on the configured code07 when performing a redirection, depending on the configured code08 when performing a redirection, depending on the configured code00 for an invalid or too large request01 when an authentication is required to perform the action (when

    accessing the stats page)03 when a request is forbidden by a "block" ACL or "reqdeny" filter08 when the request timeout strikes before the request is complete00 when haproxy encounters an unrecoverable internal error, such as a

    memory allocation failure, which should never happen

    http://users/felipewd/bla.html#reqdenyhttp://users/felipewd/bla.html#blockhttp://users/felipewd/bla.html#1.3.1http://users/felipewd/bla.html#1.2.2http://users/felipewd/bla.html#path

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    5/171

    02 when the server returns an empty, invalid or incomplete response, orwhen an "rspdeny" filter blocks the response.

    03 when no server was available to handle the request, or in response tomonitoring requests which match the "monitor fail" condition

    04 when the response timeout strikes before the server responds

    error 4xx and 5xx codes above may be customized (see "errorloc" in section.

    2. The response headers

    ponse headers work exactly like request headers, and as such, HAProxy usessame parsing function for both. Please refer to paragraph 1.2.2 for moreails.

    Configuring HAProxyConfiguration file format

    oxy's configuration process involves 3 major sources of parameters :

    the arguments from the command-line, which always take precedencethe "global" section, which sets process-wide parametersthe proxies sections which can take form of "defaults", "listen","frontend" and "backend".

    configuration file syntax consists in lines beginning with a keywordrenced in this manual, optionally followed by one or several parametersmited by spaces.

    Quoting and escaping

    oxy's configuration introduces a quoting and escaping system similar toy programming languages. The configuration file supports 3 types: escapingh a backslash, weak quoting with double quotes, and strong quoting withgle quotes.

    paces have to be entered in strings, then they must be escaped by precedingm by a backslash ('\') or by quoting them. Backslashes also have to beaped by doubling or strong quoting them.

    aping is achieved by preceding a special character by a backslash ('\'):

    to mark a space and differentiate it from a delimiter# to mark a hash and differentiate it from a comment to use a backslash to use a single quote and differentiate it from strong quoting to use a double quote and differentiate it from weak quoting

    k quoting is achieved by using double quotes (""). Weak quoting preventsinterpretation of:

    space as a parameter separatorsingle quote as a strong quoting delimiterhash as a comment start

    k quoting permits the interpretation of variables, if you want to use a nonerpreted dollar within a double quoted string, you should escape it with a

    kslash ("\$"), it does not work outside weak quoting.

    rpretation of escaping and special characters are not prevented by weaking.

    ng quoting is achieved by using single quotes (''). Inside single quotes,hing is interpreted, it's the efficient way to quote regexes.

    ed and escaped strings are replaced in memory by their interpretedvalent, it allows you to perform concatenation.

    mple:

    ose are equivalents:format %{+Q}o\ %t\ %s\ %{-Q}rformat "%{+Q}o %t %s %{-Q}r"format '%{+Q}o %t %s %{-Q}r'format "%{+Q}o %t"' %s %{-Q}r'format "%{+Q}o %t"' %s'\ %{-Q}r

    ose are equivalents:ep "^([^\ :]*)\ /static/(.*)" \1\ /\2ep "^([^ :]*)\ /static/(.*)" '\1 /\2'ep "^([^ :]*)\ /static/(.*)" "\1 /\2"ep "^([^ :]*)\ /static/(.*)" "\1\ /\2"

    Environment variables

    oxy's configuration supports environment variables. Those variables arerpreted only within double quotes. Variables are expanded during theiguration parsing. Variable names must be preceded by a dollar ("$") andonally enclosed with braces ("{}") similarly to what is done in Bournel. Variable names can contain alphanumerical characters or the characterrscore ("_") but should not start with a digit.

    mple:

    d "fd@${FD_APP1}"

    http://users/felipewd/bla.html#1.3.2http://users/felipewd/bla.html#errorlochttp://users/felipewd/bla.html#monitor%20failhttp://users/felipewd/bla.html#rspdeny

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    6/171

    "${LOCAL_SYSLOG}:514" local0 notice # send to local server

    "$HAPROXY_USER"

    Time format

    parameters involve values representing time, such as timeouts. Thesees are generally expressed in milliseconds (unless explicitly statedrwise) but may be expressed in any other unit by suffixing the unit to theric value. It is important to consider this because it will not be repeatedevery keyword. Supported units are :

    us : microseconds. 1 microsecond = 1/1000000 secondms : milliseconds. 1 millisecond = 1/1000 second. This is the default.s : seconds. 1s = 1000msm : minutes. 1m = 60s = 60000msh : hours. 1h = 60m = 3600s = 3600000msd : days. 1d = 24h = 1440m = 86400s = 86400000ms

    Examples

    # Simple configuration for an HTTP proxy listening on port 80 on all# interfaces and forwarding requests to a single backend "servers" with a# single server "server1" listening on 127.0.0.1:8000global

    daemonmaxconn 256

    defaultsmode httptimeout connect 5000mstimeout client 50000mstimeout server 50000ms

    frontend http-inbind *:80default_backend servers

    backend serversserver server1 127.0.0.1:8000 maxconn 32

    # The same configuration defined with a single listen block. Shorter but# less expressive, especially in HTTP mode.global

    daemonmaxconn 256

    defaultsmode httptimeout connect 5000ms

    timeout client 50000mstimeout server 50000ms

    listen http-inbind *:80server server1 127.0.0.1:8000 maxconn 32

    ming haproxy is in $PATH, test these configurations in a shell with:

    $ sudo haproxy -f configuration.conf -c

    Global parameters

    ameters in the "global" section are process-wide and often OS-specific. Theygenerally set once for all and do not need being changed once correct. Some

    hem have command-line equivalents.

    following keywords are supported in the "global" section :

    rocess management and securityca-basechrootcrt-basecpu-mapdaemondescriptiondeviceatlas-json-filedeviceatlas-log-leveldeviceatlas-separatordeviceatlas-properties-cookieexternal-checkgidgrouplog

    log-taglog-send-hostnamelua-loadnbprocnodepidfileuidulimit-nuserstatsssl-default-bind-ciphers

    http://users/felipewd/bla.html#ssl-default-bind-ciphershttp://users/felipewd/bla.html#statshttp://users/felipewd/bla.html#userhttp://users/felipewd/bla.html#ulimit-nhttp://users/felipewd/bla.html#uidhttp://users/felipewd/bla.html#pidfilehttp://users/felipewd/bla.html#nodehttp://users/felipewd/bla.html#nbprochttp://users/felipewd/bla.html#lua-loadhttp://users/felipewd/bla.html#log-send-hostnamehttp://users/felipewd/bla.html#log-taghttp://users/felipewd/bla.html#loghttp://users/felipewd/bla.html#grouphttp://users/felipewd/bla.html#gidhttp://users/felipewd/bla.html#external-checkhttp://users/felipewd/bla.html#deviceatlas-properties-cookiehttp://users/felipewd/bla.html#deviceatlas-separatorhttp://users/felipewd/bla.html#deviceatlas-log-levelhttp://users/felipewd/bla.html#deviceatlas-json-filehttp://users/felipewd/bla.html#descriptionhttp://users/felipewd/bla.html#daemonhttp://users/felipewd/bla.html#cpu-maphttp://users/felipewd/bla.html#crt-basehttp://users/felipewd/bla.html#chroothttp://users/felipewd/bla.html#ca-base

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    7/171

    http://users/felipewd/bla.html#3.1-chroothttp://users/felipewd/bla.html#ca-basehttp://users/felipewd/bla.html#crl-file%20%28Server%20and%20default-server%20options%29http://users/felipewd/bla.html#crl-file%20%28Bind%20options%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#ca-file%20%28Server%20and%20default-server%20options%29http://users/felipewd/bla.html#ca-file%20%28Bind%20options%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#crl-file%20%28Server%20and%20default-server%20options%29http://users/felipewd/bla.html#crl-file%20%28Bind%20options%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#ca-file%20%28Server%20and%20default-server%20options%29http://users/felipewd/bla.html#ca-file%20%28Bind%20options%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#3.1-ca-basehttp://users/felipewd/bla.html#quiethttp://users/felipewd/bla.html#debughttp://users/felipewd/bla.html#tune.zlib.windowsizehttp://users/felipewd/bla.html#tune.zlib.memlevelhttp://users/felipewd/bla.html#tune.vars.txn-max-sizehttp://users/felipewd/bla.html#tune.vars.sess-max-sizehttp://users/felipewd/bla.html#tune.vars.reqres-max-sizehttp://users/felipewd/bla.html#tune.vars.global-max-sizehttp://users/felipewd/bla.html#tune.ssl.ssl-ctx-cache-sizehttp://users/felipewd/bla.html#tune.ssl.default-dh-paramhttp://users/felipewd/bla.html#tune.ssl.maxrecordhttp://users/felipewd/bla.html#tune.ssl.force-private-cachehttp://users/felipewd/bla.html#tune.ssl.lifetimehttp://users/felipewd/bla.html#tune.ssl.cachesizehttp://users/felipewd/bla.html#tune.sndbuf.serverhttp://users/felipewd/bla.html#tune.sndbuf.clienthttp://users/felipewd/bla.html#tune.recv_enoughhttp://users/felipewd/bla.html#tune.rcvbuf.serverhttp://users/felipewd/bla.html#tune.rcvbuf.clienthttp://users/felipewd/bla.html#tune.pipesizehttp://users/felipewd/bla.html#tune.pattern.cache-sizehttp://users/felipewd/bla.html#tune.maxrewritehttp://users/felipewd/bla.html#tune.maxpolleventshttp://users/felipewd/bla.html#tune.maxaccepthttp://users/felipewd/bla.html#tune.lua.service-timeouthttp://users/felipewd/bla.html#tune.lua.task-timeouthttp://users/felipewd/bla.html#tune.lua.session-timeouthttp://users/felipewd/bla.html#tune.lua.maxmemhttp://users/felipewd/bla.html#tune.lua.forced-yieldhttp://users/felipewd/bla.html#tune.idletimerhttp://users/felipewd/bla.html#tune.http.maxhdrhttp://users/felipewd/bla.html#tune.http.cookielenhttp://users/felipewd/bla.html#tune.comp.maxlevelhttp://users/felipewd/bla.html#tune.chksizehttp://users/felipewd/bla.html#tune.bufsizehttp://users/felipewd/bla.html#tune.buffers.reservehttp://users/felipewd/bla.html#tune.buffers.limithttp://users/felipewd/bla.html#server-state-filehttp://users/felipewd/bla.html#server-state-basehttp://users/felipewd/bla.html#spread-checkshttp://users/felipewd/bla.html#nogetaddrinfohttp://users/felipewd/bla.html#nosplicehttp://users/felipewd/bla.html#nopollhttp://users/felipewd/bla.html#nokqueuehttp://users/felipewd/bla.html#noepollhttp://users/felipewd/bla.html#maxzlibmemhttp://users/felipewd/bla.html#maxsslratehttp://users/felipewd/bla.html#maxsslconnhttp://users/felipewd/bla.html#maxsessratehttp://users/felipewd/bla.html#maxpipeshttp://users/felipewd/bla.html#maxcompcpuusagehttp://users/felipewd/bla.html#maxcompratehttp://users/felipewd/bla.html#maxconnratehttp://users/felipewd/bla.html#maxconnhttp://users/felipewd/bla.html#max-spread-checkshttp://users/felipewd/bla.html#51degrees-cache-sizehttp://users/felipewd/bla.html#51degrees-property-separatorhttp://users/felipewd/bla.html#51degrees-property-name-listhttp://users/felipewd/bla.html#51degrees-data-filehttp://users/felipewd/bla.html#unix-bindhttp://users/felipewd/bla.html#ssl-server-verifyhttp://users/felipewd/bla.html#ssl-dh-param-filehttp://users/felipewd/bla.html#ssl-default-server-optionshttp://users/felipewd/bla.html#ssl-default-server-ciphershttp://users/felipewd/bla.html#ssl-default-bind-options

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    8/171

    nges current directory to and performs a chroot() there beforeping privileges. This increases the security level in case an unknownnerability would be exploited, since it would make it very hard for theacker to exploit the system. This only works when the process is startedh superuser privileges. It is important to ensure that is bothy and unwritable to anyone.

    map  ...

    inux 2.6 and above, it is possible to bind a process to a specific CPU This means that the process will never run on other CPUs. The "cpu-map"ctive specifies CPU sets for process sets. The first argument is theess number to bind. This process must have a number between 1 and 32 ordepending on the machine's word size, and any process IDs above nbprocignored. It is possible to specify all processes at once using "all",odd numbers using "odd" or even numbers using "even", just like with thed-process" directive. The second and forthcoming arguments are CPU sets.h CPU set is either a unique number between 0 and 31 or 63 or a range with

    such numbers delimited by a dash ('-'). Multiple CPU numbers or rangesbe specified, and the processes will be allowed to bind to all of them.ously, multiple "cpu-map" directives may be specified. Each "cpu-map"ctive will replace the previous ones when they overlap.

    base 

    gns a default directory to fetch SSL certificates from when a relativeh is used with "crtfile" directives. Absolute locations specified afterfile" prevail and ignore "crt-base".

    mon

    s the process fork into background. This is the recommended mode ofation. It is equivalent to the command line "-D" argument. It can be

    abled by the command line "-db" argument.

    ceatlas-json-file 

    the path of the DeviceAtlas JSON data file to be loaded by the API.path must be a valid JSON data file and accessible by Haproxy process.

    ceatlas-log-level 

    the level of informations returned by the API. This directive isonal and set to 0 by default if not set.

    ceatlas-separator 

    the character separator for the API properties results. This directiveptional and set to | by default if not set.

    ceatlas-properties-cookie 

    the client cookie's name used for the detection if the DeviceAtlasnt-side component was used during the request. This directive is optionalset to DAPROPS by default if not set.

    rnal-check

    ws the use of an external agent to perform health checks. is disabled by default as a security precaution."option external-check".

    nges the process' group ID to . It is recommended that the groups dedicated to HAProxy or to a small set of similar daemons. HAProxy musttarted with a user belonging to this group, or with superuser privileges. that if haproxy is started from a user having supplementary groups, it only be able to drop these groups if started with superuser privileges.also "group

    This keyword is available in sections :Process management and securityUserlistsBind options

    d "uid

    This keyword is available in sections :Process management and securityBind options

    up 

    lar to "gid

    This keyword is available in sections :Process management and securityBind options

    t uses the GID of group name from /etc/group.also "gid

    This keyword is available in sections :Process management and securityBind options

    d "user

    This keyword is available in sections :Process management and securityUserlistsBind options

    http://users/felipewd/bla.html#user%20%28Bind%20options%29http://users/felipewd/bla.html#user%20%28Userlists%29http://users/felipewd/bla.html#user%20%28Process%20management%20and%20security%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#gid%20%28Bind%20options%29http://users/felipewd/bla.html#gid%20%28Process%20management%20and%20security%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#gid%20%28Bind%20options%29http://users/felipewd/bla.html#gid%20%28Process%20management%20and%20security%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#3.1-grouphttp://users/felipewd/bla.html#uid%20%28Bind%20options%29http://users/felipewd/bla.html#uid%20%28Process%20management%20and%20security%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#group%20%28Bind%20options%29http://users/felipewd/bla.html#group%20%28Userlists%29http://users/felipewd/bla.html#group%20%28Process%20management%20and%20security%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#option%20external-checkhttp://users/felipewd/bla.html#3.1-external-checkhttp://users/felipewd/bla.html#3.1-deviceatlas-properties-cookiehttp://users/felipewd/bla.html#3.1-deviceatlas-separatorhttp://users/felipewd/bla.html#3.1-deviceatlas-log-levelhttp://users/felipewd/bla.html#3.1-deviceatlas-json-filehttp://users/felipewd/bla.html#3.1-daemonhttp://users/felipewd/bla.html#crt-basehttp://users/felipewd/bla.html#3.1-crt-basehttp://users/felipewd/bla.html#cpu-maphttp://users/felipewd/bla.html#cpu-maphttp://users/felipewd/bla.html#bind-processhttp://users/felipewd/bla.html#evenhttp://users/felipewd/bla.html#oddhttp://users/felipewd/bla.html#cpu-maphttp://users/felipewd/bla.html#evenhttp://users/felipewd/bla.html#oddhttp://users/felipewd/bla.html#3.1-cpu-map

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    9/171

     [len ] [format ]  [max level [min level]]

    a global syslog server. Up to two global servers can be defined. They receive logs for startups and exits, as well as all logs from proxiesigured with "log global".

    dress> can be one of:

    - An IPv4 address optionally followed by a colon and a UDP port. Ifno port is specified, 514 is used by default (the standard syslogport).

    - An IPv6 address followed by a colon and optionally a UDP port. Ifno port is specified, 514 is used by default (the standard syslogport).

    - A filesystem path to a UNIX domain socket, keeping in mindconsiderations for chroot (be sure the path is accessible insidethe chroot) and uid/gid (be sure the path is appropriatelywriteable).

    You may want to reference some environment variables in the addressparameter, see section 2.3 about environment variables.

    ngth> is an optional maximum line length. Log lines larger than this valuewill be truncated before being sent. The reason is that syslogservers act differently on log line length. All servers support thedefault value of 1024, but some servers simply drop larger lineswhile others do log them. If a server supports long lines, it maymake sense to set this value here in order to avoid truncating longlines. Similarly, if a server drops long lines, it is preferable totruncate them before sending them. Accepted values are 80 to 65535inclusive. The default value of 1024 is generally fine for allstandard usages. Some specific cases of long captures orJSON-formated logs may require larger values.

    mat> is the log format used when generating syslog messages. It may beone of the following :

    c3164 The RFC3164 syslog message format. This is the default.(https://tools.ietf.org/html/rfc3164)

    c5424 The RFC5424 syslog message format.(https://tools.ietf.org/html/rfc5424)

    ility> must be one of the 24 standard syslog facilities :

    kern user mail daemon auth syslog lpr newsuucp cron auth2 ftp ntp audit alert cron2local0 local1 local2 local3 local4 local5 local6 local7

    ptional level can be specified to filter outgoing messages. By default,messages are sent. If a maximum level is specified, only messages with a

    rity at least as important as this level will be sent. An optional minimum l can be specified. If it is set, logs emitted with a more severe leveln this one will be capped to this level. This is used to avoid sendingrg" messages on all terminals on some default syslog configurations.t levels are known :

    emerg alert crit err warning notice info debug

    send-hostname []

    the hostname field in the syslog header. If optional "string" parameteret the header is set to the string contents, otherwise uses the hostnamehe system. Generally used if one is not relaying logs through anrmediate syslog server or for simply customizing the hostname printed inlogs.

    tag 

    the tag field in the syslog header to this string. It defaults to the

    gram name as launched from the command line, which usually is "haproxy".times it can be useful to differentiate between multiple processes

    ning on the same host. See also the per-proxy "log-tag

    This keyword is available in sections :Process management and securityAlphabetically sorted keywords reference

    rective.

    load 

    global directive loads and executes a Lua file. This directive can bed multiple times.

    roc 

    ates processes when going daemon. This requires the "daemon". By default, only one process is created, which is the recommended mode

    peration. For systems limited to small sets of file descriptors peress, it may be needed to fork multiple daemons. USING MULTIPLE PROCESSESARDER TO DEBUG AND IS REALLY DISCOURAGED. See also "daemon".

    le 

    es pids of all daemons into file . This option is equivalent to"-p" command line argument. The file must be accessible to the userting the process. See also "daemon".

    s bind-process [ all | odd | even | [-] ] ...

    http://users/felipewd/bla.html#3.1-stats%20bind-processhttp://users/felipewd/bla.html#daemonhttp://users/felipewd/bla.html#3.1-pidfilehttp://users/felipewd/bla.html#daemonhttp://users/felipewd/bla.html#daemonhttp://users/felipewd/bla.html#3.1-nbprochttp://users/felipewd/bla.html#3.1-lua-loadhttp://users/felipewd/bla.html#log-tag%20%28Alphabetically%20sorted%20keywords%20reference%29http://users/felipewd/bla.html#log-tag%20%28Process%20management%20and%20security%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#3.1-log-taghttp://users/felipewd/bla.html#3.1-log-send-hostnamehttp://users/felipewd/bla.html#2.3http://users/felipewd/bla.html#log%20global

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    10/171

    ts the stats socket to a certain set of processes numbers. By default thes socket is bound to all processes, causing a warning to be emitted whenoc is greater than 1 because there is no way to select the target process

    n connecting. However, by using this setting, it becomes possible to pinstats socket to a specific set of processes, typically the first one. Thening will automatically be disabled when this setting is used, whatevernumber of processes used. The maximum process ID depends on the machine'sd size (32 or 64). A better option consists in using the "process" settinghe "stats socket" line to force the process on each line.

    er-state-base 

    ifies the directory prefix to be prepended in front of all servers state names which do not start with a '/'. See also "server-state-file",d-server-state-from-file" and "server-state-file-name".

    er-state-file 

    ifies the path to the file containing state of servers. If the path startsh a slash ('/'), it is considered absolute, otherwise it is consideredative to the directory specified using "server-state-base" (if set) or tocurrent directory. Before reloading HAProxy, it is possible to save thevers' current state using the stats command "show servers state". Theput of this command must be written in the file pointed by . Whenting up, before handling traffic, HAProxy will read, load and apply stateeach server found in the file and available in its current runningiguration. See also "server-state-base" and "show servers state",d-server-state-from-file" and "server-state-file-name"

    efault-bind-ciphers 

    setting is only available when support for OpenSSL was built in. It setsdefault string describing the list of cipher algorithms ("cipher suite") are negotiated during the SSL/TLS handshake for all "bind" lines whichot explicitly define theirs. The format of the string is defined inn 1 ciphers" from OpenSSL man pages, and can be for instance a string suchAES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH" (without quotes). Please check the

    d" keyword for more information.

    efault-bind-options []...

    setting is only available when support for OpenSSL was built in. It setsault ssl-options to force on all "bind" lines. Please check the "bind"word to see available options.

    mple:

    alsl-default-bind-options no-sslv3 no-tls-tickets

    efault-server-ciphers 

    setting is only available when support for OpenSSL was built in. It the default string describing the list of cipher algorithms that aretiated during the SSL/TLS handshake with the server, for all "server"s which do not explicitly define theirs. The format of the string isned in "man 1 ciphers". Please check the "server" keyword for morermation.

    efault-server-options []...

    setting is only available when support for OpenSSL was built in. It setsault ssl-options to force on all "server" lines. Please check the "server"word to see available options.

    h-param-file 

    setting is only available when support for OpenSSL was built in. It setsdefault DH parameters that are used during the SSL/TLS handshake whenmeral Diffie-Hellman (DHE) key exchange is used, for all "bind" linesh do not explicitely define theirs. It will be overridden by custom DH

    ameters found in a bind certificate file if any. If custom DH parametersnot specified either by using ssl-dh-param-file or by setting them ctly in the certificate file, pre-generated DH parameters of the size

    ified by tune.ssl.default-dh-param will be used. Custom parameters aren to be more secure and therefore their use is recommended.om DH parameters may be generated by using the OpenSSL commandnssl dhparam ", where size should be at least 2048, as 1024-bit DH

    ameters should not be considered secure anymore.

    erver-verify [none|required]

    default behavior for SSL verify on servers side. If specified to 'none',vers certificates are not verified. The default is 'required' except ifed using cmdline option '-dV'.

    s socket [|] [param*]

    ds a UNIX socket to or a TCPv4/v6 address to .nections to this socket will return various statistics outputs and evenw some commands to be issued to change some runtime settings. Pleaseult section 9.2 "Unix Socket commands" of Management Guide for more

    ails.

    parameters supported by "bind" lines are supported, for instance torict access to some users or their access rights. Please consultion 5.1 for more information.

    s timeout 

    default timeout on the stats socket is set to 10 seconds. It is possiblehange this value with "stats timeout". The value must be passed iniseconds, or be suffixed by a time unit among { us, ms, s, m, h, d }.

    http://users/felipewd/bla.html#stats%20timeouthttp://users/felipewd/bla.html#3.1-stats%20timeouthttp://users/felipewd/bla.html#5.1http://users/felipewd/bla.html#bindhttp://users/felipewd/bla.html#9.2http://users/felipewd/bla.html#3.1-stats%20sockethttp://users/felipewd/bla.html#3.1-ssl-server-verifyhttp://users/felipewd/bla.html#bindhttp://users/felipewd/bla.html#3.1-ssl-dh-param-filehttp://users/felipewd/bla.html#serverhttp://users/felipewd/bla.html#serverhttp://users/felipewd/bla.html#3.1-ssl-default-server-optionshttp://users/felipewd/bla.html#serverhttp://users/felipewd/bla.html#serverhttp://users/felipewd/bla.html#3.1-ssl-default-server-ciphershttp://users/felipewd/bla.html#bindhttp://users/felipewd/bla.html#bindhttp://users/felipewd/bla.html#3.1-ssl-default-bind-optionshttp://users/felipewd/bla.html#bindhttp://users/felipewd/bla.html#bindhttp://users/felipewd/bla.html#3.1-ssl-default-bind-ciphershttp://users/felipewd/bla.html#server-state-file-namehttp://users/felipewd/bla.html#load-server-state-from-filehttp://users/felipewd/bla.html#server-state-basehttp://users/felipewd/bla.html#server-state-basehttp://users/felipewd/bla.html#3.1-server-state-filehttp://users/felipewd/bla.html#server-state-file-namehttp://users/felipewd/bla.html#load-server-state-from-filehttp://users/felipewd/bla.html#server-state-filehttp://users/felipewd/bla.html#3.1-server-state-basehttp://users/felipewd/bla.html#stats%20sockethttp://users/felipewd/bla.html#process

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    11/171

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    12/171

    ase note that this option is only available when haproxy has beenpiled with USE_51DEGREES.

    egrees-cache-size 

    the size of the 51Degrees converter cache to entries. Thisn LRU cache which reminds previous device detections and their results.efault, this cache is disabled.

    ase note that this option is only available when haproxy has beenpiled with USE_51DEGREES.

    Performance tuning

    -spread-checks 

    efault, haproxy tries to spread the start of health checks across thelest health check interval of all the servers in a farm. The principle isvoid hammering services running on the same server. But when using largek intervals (10 seconds or more), the last servers in the farm take some before starting to be tested, which can be a problem. This parameter is

    d to enforce an upper bound on delay between the first and the last check,n if the servers' check intervals are larger. When servers run withter intervals, their intervals will be respected though.

    conn 

    the maximum per-process number of concurrent connections to . Itquivalent to the command-line argument "-n". Proxies will stop acceptingnections when this limit is reached. The "ulimit-n" parameter ismatically adjusted according to this value. See also "ulimit-n". Note:"select" poller cannot reliably use more than 1024 file descriptors on platforms. If your platform only supports select and reports "selectED" on startup, you need to reduce maxconn until it works (slightly

    w 500 in general). If this value is not set, it will default to the valuein DEFAULT_MAXCONN at build time (reported in haproxy -vv) if no memoryt is enforced, or will be computed based on the memory limit, the buffer, memory allocated to compression, SSL cache size, and use or not of SSLthe associated maxsslconn (which can also be automatic).

    connrate 

    the maximum per-process number of connections per second to .xies will stop accepting connections when this limit is reached. It can bed to limit the global capacity regardless of each frontend capacity. It isrtant to note that this can only be used as a service protection measure,here will not necessarily be a fair share between frontends when thet is reached, so it's a good idea to also limit each frontend to somee close to its expected share. Also, lowering tune.maxaccept can improveness.

    comprate 

    the maximum per-process input compression rate to kilobytessecond. For each session, if the maximum is reached, the compressionl will be decreased during the session. If the maximum is reached at thenning of a session, the session will not compress at all. If the maximum ot reached, the compression level will be increased up to.comp.maxlevel. A value of zero means there is no limit, this is the

    ault value.

    compcpuusage 

    the maximum CPU usage HAProxy can reach before stopping the compressionnew requests or decreasing the compression level of current requests.orks like 'maxcomprate' but measures CPU usage instead of incoming datadwidth. The value is expressed in percent of the CPU used by haproxy. In of multiple processes (nbproc > 1), each process manages its individual

    ge. A value of 100 disable the limit. The default value is 100. Settingwer value will prevent the compression work from slowing the wholeess down and from introducing high latencies.

    pipes 

    the maximum per-process number of pipes to . Currently, pipesonly used by kernel-based tcp splicing. Since a pipe contains two fileriptors, the "ulimit-n" value will be increased accordingly. The defaulte is maxconn/4, which seems to be more than enough for most heavy usages.splice code dynamically allocates and releases pipes, and can fall backtandard copy, so setting this value too low may only impact performance.

    sessrate 

    the maximum per-process number of sessions per second to .xies will stop accepting connections when this limit is reached. It can bed to limit the global capacity regardless of each frontend capacity. It isrtant to note that this can only be used as a service protection measure,here will not necessarily be a fair share between frontends when thet is reached, so it's a good idea to also limit each frontend to somee close to its expected share. Also, lowering tune.maxaccept can improve

    ness.

    sslconn 

    the maximum per-process number of concurrent SSL connections tomber>. By default there is no SSL-specific limit, which means that thebal maxconn setting will apply to all connections. Setting this limitds having openssl use too much memory and crash when malloc returns NULL

    nce it unfortunately does not reliably check for such conditions). Notethe limit applies both to incoming and outgoing connections, so one

    nection which is deciphered then ciphered accounts for 2 SSL connections.his value is not set, but a memory limit is enforced, this value will be

    http://users/felipewd/bla.html#3.2-maxsslconnhttp://users/felipewd/bla.html#3.2-maxsessratehttp://users/felipewd/bla.html#ulimit-nhttp://users/felipewd/bla.html#3.2-maxpipeshttp://users/felipewd/bla.html#3.2-maxcompcpuusagehttp://users/felipewd/bla.html#3.2-maxcompratehttp://users/felipewd/bla.html#3.2-maxconnratehttp://users/felipewd/bla.html#ulimit-nhttp://users/felipewd/bla.html#ulimit-nhttp://users/felipewd/bla.html#3.2-maxconnhttp://users/felipewd/bla.html#3.2-max-spread-checkshttp://users/felipewd/bla.html#3.1-51degrees-cache-size

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    13/171

    matically computed based on the memory limit, maxconn, the buffer size,ry allocated to compression, SSL cache size, and use of SSL in either

    ntends, backends or both. If neither maxconn nor maxsslconn are specifiedn there is a memory limit, haproxy will automatically adjust these valueshat 100% of the connections can be made over SSL with no risk, and willider the sides where it is enabled (frontend, backend, both).

    sslrate 

    the maximum per-process number of SSL sessions per second to .listeners will stop accepting connections when this limit is reached. Itbe used to limit the global SSL CPU usage regardless of each frontendacity. It is important to note that this can only be used as a serviceection measure, as there will not necessarily be a fair share between

    ntends when the limit is reached, so it's a good idea to also limit eachntend to some value close to its expected share. It is also important to that the sessions are accounted before they enter the SSL stack and notr, which also protects the stack against bad handshakes. Also, lowering

    .maxaccept can improve fairness.

    zlibmem 

    the maximum amount of RAM in megabytes per process usable by the zlib.n the maximum amount is reached, future sessions will not compress as longAM is unavailable. When sets to 0, there is no limit.default value is 0. The value is available in bytes on the UNIX socketh "show info" on the line "MaxZlibMemUsage", the memory used by zlib isbMemUsage" in bytes.

    poll

    bles the use of the "epoll" event polling system on Linux. It isvalent to the command-line argument "-de". The next polling system 

    d will generally be "poll". See also "nopoll".

    queue

    ables the use of the "kqueue" event polling system on BSD. It isvalent to the command-line argument "-dk". The next polling system 

    d will generally be "poll". See also "nopoll".

    oll

    ables the use of the "poll" event polling system. It is equivalent to themand-line argument "-dp". The next polling system used will be "select".hould never be needed to disable "poll" since it's available on allforms supported by HAProxy. See also "nokqueue" and "noepoll".

    plice

    ables the use of kernel tcp splicing between sockets on Linux. It isvalent to the command line argument "-dS". Data will then be copiedg conventional and more portable recv/send calls. Kernel tcp splicing isted to some very recent instances of kernel 2.6. Most versions between25 and 2.6.28 are buggy and will forward corrupted data, so they must notsed. This option makes it easier to globally disable kernel splicing in of doubt. See also "option splice-auto", "option splice-request" andion splice-response".

    etaddrinfo

    ables the use of getaddrinfo(3) for name resolving. It is equivalent tocommand line argument "-dG". Deprecated gethostbyname(3) will be used.

    ad-checks 

    times it is desirable to avoid sending agent and health checks tovers at exact intervals, for instance when many logical servers areated on the same physical server. With the help of this parameter, itmes possible to add some randomness in the check interval between 0+/- 50%. A value between 2 and 5 seems to show good results. Theault value remains at 0.

    .buffers.limit 

    a hard limit on the number of buffers which may be allocated per process.default value is zero which means unlimited. The minimum non-zero value always be greater than "tune.buffers.reserve" and should ideally alwaysbout twice as large. Forcing this value can be particularly useful tot the amount of memory a process may take, while retaining a sane

    aviour. When this limit is reached, sessions which need a buffer wait forher one to be released by another session. Since buffers are dynamicallycated and released, the waiting time is very short and not perceptible

    vided that limits remain reasonable. In fact sometimes reducing the limiteven increase performance by increasing the CPU cache's efficiency. Tests shown good results on average HTTP traffic with a limit to 1/10 of thected global maxconn setting, which also significantly reduces memory

    ge. The memory savings come from the fact that a number of connections not allocate 2*tune.bufsize. It is best not to touch this value unlesssed to do so by an haproxy core developer.

    .buffers.reserve 

    the number of buffers which are pre-allocated and reserved for use onlyng memory shortage conditions resulting in failed memory allocations. Themum value is 2 and is also the default. There is no reason a user would to change this value, it's mostly aimed at haproxy core developers.

    .bufsize 

    the buffer size to this size (in bytes). Lower values allow moreions to coexist in the same amount of RAM, and higher values allow someications with very large cookies to work. The default value is 16384 andbe changed at build time. It is strongly recommended not to change this

    http://users/felipewd/bla.html#3.2-tune.bufsizehttp://users/felipewd/bla.html#3.2-tune.buffers.reservehttp://users/felipewd/bla.html#tune.buffers.reservehttp://users/felipewd/bla.html#3.2-tune.buffers.limithttp://users/felipewd/bla.html#3.2-spread-checkshttp://users/felipewd/bla.html#3.2-nogetaddrinfohttp://users/felipewd/bla.html#option%20splice-responsehttp://users/felipewd/bla.html#option%20splice-requesthttp://users/felipewd/bla.html#option%20splice-autohttp://users/felipewd/bla.html#3.2-nosplicehttp://users/felipewd/bla.html#noepollhttp://users/felipewd/bla.html#nokqueuehttp://users/felipewd/bla.html#3.2-nopollhttp://users/felipewd/bla.html#nopollhttp://users/felipewd/bla.html#3.2-nokqueuehttp://users/felipewd/bla.html#nopollhttp://users/felipewd/bla.html#3.2-noepollhttp://users/felipewd/bla.html#3.2-maxzlibmemhttp://users/felipewd/bla.html#3.2-maxsslrate

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    14/171

    m the default value, as very low values will break some services such asistics, and values larger than default size will increase memory usage,ibly causing the system to run out of memory. At least the global maxconnameter should be decreased by the same factor as this one is increased.TTP request is larger than (tune.bufsize - tune.maxrewrite), haproxy willrn HTTP 400 (Bad Request) error. Similarly if an HTTP response is larger

    n this size, haproxy will return HTTP 502 (Bad Gateway).

    .chksize 

    the check buffer size to this size (in bytes). Higher values may helpd string or regex patterns in very large pages, though doing so may imply memory and CPU usage. The default value is 16384 and can be changed atd time. It is not recommended to change this value, but to use betterks whenever possible.

    .comp.maxlevel 

    the maximum compression level. The compression level affects CPUge during compression. This value affects CPU usage during compression.h session using compression initializes the compression algorithm with value. The default value is 1.

    .http.cookielen 

    the maximum length of captured cookies. This is the maximum value that"capture cookie xxx len yyy" will be allowed to take, and any upper value automatically be truncated to this one. It is important not to set tooa value because all cookie captures still allocate this size whateverr configured value (they share a same pool). This value is per requestresponse, so the memory allocated is twice this value per connection.n not specified, the limit is set to 63 characters. It is recommended nothange this value.

    .http.maxhdr 

    the maximum number of headers in a request. When a request comes with a

    ber of headers greater than this value (including the first line), it iscted with a "400 Bad Request" status code. Similarly, too large responsesblocked with "502 Bad Gateway". The default value is 101, which is enoughall usages, considering that the widely deployed Apache server uses the limit. It can be useful to push this limit further to temporarily allowggy application to work by the time it gets fixed. Keep in mind that eachheader consumes 32bits of memory for each session, so don't push thist too high.

    .idletimer 

    the duration after which haproxy will consider that an empty buffer isbably associated with an idle stream. This is used to optimally adjust packet sizes while forwarding large and small data alternatively. Thesion to use splice() or to send large buffers in SSL is modulated by this

    ameter. The value is in milliseconds between 0 and 65535. A value of zerons that haproxy will not try to detect idle streams. The default is 1000,h seems to correctly detect end user pauses (eg: read a page beforeking). There should be not reason for changing this value. Please check.ssl.maxrecord below.

    .lua.forced-yield 

    directive forces the Lua engine to execute a yield each ofructions executed. This permits interruptng a long script and allows theoxy scheduler to process other tasks like accepting connections or

    warding traffic. The default value is 10000 instructions. If HAProxy oftenutes some Lua code but more reactivity is required, this value can bered. If the Lua code is quite long and its result is absolutely required

    process the data, the can be increased.

    .lua.maxmem

    the maximum amount of RAM in megabytes per process usable by Lua. Byault it is zero which means unlimited. It is important to set a limit tore that a bug in a script will not result in the system running out ofry.

    .lua.session-timeout 

    is the execution timeout for the Lua sessions. This is useful forventing infinite loops or spending too much time in Lua. This timeoutnts only the pure Lua runtime. If the Lua does a sleep, the sleep istaked in account. The default timeout is 4s.

    .lua.task-timeout 

    pose is the same as "tune.lua.session-timeout", but this timeout iscated to the tasks. By default, this timeout isn't set because a task may

    ain alive during of the lifetime of HAProxy. For example, a task used tok servers.

    .lua.service-timeout 

    is the execution timeout for the Lua services. This is useful forventing infinite loops or spending too much time in Lua. This timeout

    nts only the pure Lua runtime. If the Lua does a sleep, the sleep istaked in account. The default timeout is 4s.

    .maxaccept 

    the maximum number of consecutive connections a process may accept in abefore switching to other work. In single process mode, higher numbers better performance at high connection rates. However in multi-processs, keeping a bit of fairness between processes generally is better toease performance. This value applies individually to each listener, so the number of processes a listener is bound to is taken into account.

    http://users/felipewd/bla.html#3.2-tune.maxaccepthttp://users/felipewd/bla.html#3.2-tune.lua.service-timeouthttp://users/felipewd/bla.html#tune.lua.session-timeouthttp://users/felipewd/bla.html#3.2-tune.lua.task-timeouthttp://users/felipewd/bla.html#3.2-tune.lua.session-timeouthttp://users/felipewd/bla.html#3.2-tune.lua.maxmemhttp://users/felipewd/bla.html#3.2-tune.lua.forced-yieldhttp://users/felipewd/bla.html#3.2-tune.idletimerhttp://users/felipewd/bla.html#3.2-tune.http.maxhdrhttp://users/felipewd/bla.html#3.2-tune.http.cookielenhttp://users/felipewd/bla.html#3.2-tune.comp.maxlevelhttp://users/felipewd/bla.html#3.2-tune.chksize

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    15/171

    value defaults to 64. In multi-process mode, it is divided by twicenumber of processes the listener is bound to. Setting this value to -1pletely disables the limitation. It should normally not be needed to tweak value.

    .maxpollevents 

    the maximum amount of events that can be processed at once in a call topolling system. The default value is adapted to the operating system. Itbeen noticed that reducing it below 200 tends to slightly decreasency at the expense of network bandwidth, and increasing it above 200ds to trade latency for slightly increased bandwidth.

    .maxrewrite 

    the reserved buffer space to this size in bytes. The reserved space isd for header rewriting or appending. The first reads on sockets will never more than bufsize-maxrewrite. Historically it has defaulted to half of

    ize, though that does not make much sense since there are rarely largebers of headers to add. Setting it too high prevents processing of largeests or responses. Setting it too low prevents addition of new headerslready large requests or to POST requests. It is generally wise to set itbout 1024. It is automatically readjusted to half of bufsize if it isger than that. This means you don't have to worry about it when changingize.

    .pattern.cache-size 

    the size of the pattern lookup cache to entries. This is an LRUhe which reminds previous lookups and their results. It is used by ACLsmaps on slow pattern lookups, namely the ones using the "sub", "reg",", "dom", "end", "bin" match methods as well as the case-insensitivengs. It applies to pattern expressions which means that it will be ableemorize the result of a lookup among all the patterns specified on aiguration line (including all those loaded from files). It automatically

    alidates entries which are updated using HTTP actions or on the CLI. Theault cache size is set to 10000 entries, which limits its footprint to

    t 5 MB on 32-bit systems and 8 MB on 64-bit systems. There is a very lowk of collision in this cache, which is in the order of the size of thehe divided by 2^64. Typically, at 10000 requests per second with theault cache size of 10000 entries, there's 1% chance that a brute forceck could cause a single collision after 60 years, or 0.1% after 6 years. is considered much lower than the risk of a memory corruption caused by

    ng components. If this is not acceptable, the cache can be disabled bying this parameter to 0.

    .pipesize 

    the kernel pipe buffer size to this size (in bytes). By default, pipesthe default size for the system. But sometimes when using TCP splicing,an improve performance to increase pipe sizes, especially if it ispected that pipes are not filled and that many calls to splice() areormed. This has an impact on the kernel's memory footprint, so this mustbe changed if impacts are not understood.

    .rcvbuf.client .rcvbuf.server 

    es the kernel socket receive buffer size on the client or the server sidehe specified value in bytes. This value applies to all TCP/HTTP frontendsbackends. It should normally never be set, and the default size (0) letskernel autotune this value depending on the amount of available memory.ver it can sometimes help to set it to very low values (eg: 4096) inr to save kernel memory by preventing it from buffering too large amountseceived data. Lower values will significantly increase CPU usage though.

    .recv_enough 

    oxy uses some hints to detect that a short read indicates the end of theket buffers. One of them is that a read returns more than s, which defaults to 10136 (7 segments of 1448 each). This default valuebe changed by this setting to better deal with workloads involving lotshort messages such as telnet or SSH sessions.

    .sndbuf.client 

    .sndbuf.server 

    es the kernel socket send buffer size on the client or the server side tospecified value in bytes. This value applies to all TCP/HTTP frontendsbackends. It should normally never be set, and the default size (0) letskernel autotune this value depending on the amount of available memory.ver it can sometimes help to set it to very low values (eg: 4096) inr to save kernel memory by preventing it from buffering too large amountseceived data. Lower values will significantly increase CPU usage though.her use case is to prevent write timeouts with extremely slow clients duehe kernel waiting for a large part of the buffer to be read beforefying haproxy again.

    .ssl.cachesize 

    the size of the global SSL session cache, in a number of blocks. A blockarge enough to contain an encoded session without peer certificate.ncoded session with peer certificate is stored in multiple blocksnding on the size of the peer certificate. A block uses approximatelybytes of memory. The default value may be forced at build time, otherwiseaults to 20000. When the cache is full, the most idle entries are purgedreassigned. Higher values reduce the occurrence of such a purge, hencenumber of CPU-intensive SSL handshakes by ensuring that all users keepr session as long as possible. All entries are pre-allocated upon startupare shared between all processes if "nbproc

    This keyword is available in sections :Process management and securityFetching samples from internal states

    http://users/felipewd/bla.html#nbproc%20%28Fetching%20samples%20from%20internal%20states%29http://users/felipewd/bla.html#nbproc%20%28Process%20management%20and%20security%29http://users/felipewd/bla.html#http://users/felipewd/bla.html#3.2-tune.ssl.cachesizehttp://users/felipewd/bla.html#3.2-tune.sndbuf.serverhttp://users/felipewd/bla.html#3.2-tune.sndbuf.clienthttp://users/felipewd/bla.html#3.2-tune.recv_enoughhttp://users/felipewd/bla.html#3.2-tune.rcvbuf.serverhttp://users/felipewd/bla.html#3.2-tune.rcvbuf.clienthttp://users/felipewd/bla.html#3.2-tune.pipesizehttp://users/felipewd/bla.html#binhttp://users/felipewd/bla.html#subhttp://users/felipewd/bla.html#3.2-tune.pattern.cache-sizehttp://users/felipewd/bla.html#3.2-tune.maxrewritehttp://users/felipewd/bla.html#3.2-tune.maxpollevents

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    16/171

    greater than 1. Setting value to 0 disables the SSL session cache.

    .ssl.force-private-cache

    boolean disables SSL session cache sharing between all processes. Itld normally not be used since it will force many renegotiations due tonts hitting a random process. But it may be required on some operatingems where none of the SSL cache synchronization method may be used. In case, adding a first layer of hash-based load balancing before the SSLr might limit the impact of the lack of session sharing.

    .ssl.lifetime 

    how long a cached SSL session may remain valid. This time is expressedeconds and defaults to 300 (5 min). It is important to understand that it not guarantee that sessions will last that long, because if the cache is, the longest idle sessions will be purged despite their configured

    time. The real usefulness of this setting is to prevent sessions from g used for too long.

    .ssl.maxrecord 

    the maximum amount of bytes passed to SSL_write() at a time. Defaulte 0 means there is no limit. Over SSL/TLS, the client can decipher the

    a only once it has received a full record. With large records, it means clients might have to download up to 16kB of data before starting toess them. Limiting the value can improve page load times on browsers

    ated over high latency or low bandwidth networks. It is suggested to findmal values which fit into 1 or 2 TCP segments (generally 1448 bytes overrnet with TCP timestamps enabled, or 1460 when timestamps are disabled),

    ping in mind that SSL/TLS add some overhead. Typical values of 1419 and gave good results during tests. Use "strace -e trace=write" to find the value. Haproxy will automatically switch to this setting after an idleam has been detected (see tune.idletimer above).

    .ssl.default-dh-param 

    the maximum size of the Diffie-Hellman parameters used for generatingephemeral/temporary Diffie-Hellman key in case of DHE key exchange. Theal size will try to match the size of the server's RSA (or DSA) key (e.g,48 bits temporary DH key for a 2048 bits RSA key), but will not exceed maximum value. Default value if 1024. Only 1024 or higher values arewed. Higher values will increase the CPU load, and values greater than bits are not supported by Java 7 and earlier clients. This value is not

    d if static Diffie-Hellman parameters are supplied either directlyhe certificate file or by using the ssl-dh-param-file parameter.

    .ssl.ssl-ctx-cache-size 

    the size of the cache used to store generated certificates to ies. This is a LRU cache. Because generating a SSL certificateamically is expensive, they are cached. The default cache size is set to entries.

    .vars.global-max-size 

    .vars.reqres-max-size 

    .vars.sess-max-size 

    .vars.txn-max-size 

    e four tunes helps to manage the allowed amount of memory used by theables system. "global" limits the memory for all the systems. "sess" limitmemory by session, "txn" limits the memory by transaction and "reqres"ts the memory for each request or response processing. during theunting, "sess" embbed "txn" and "txn" embed "reqres".

    xample, we considers that "tune.vars.sess-max-size" is fixed to 100,e.vars.txn-max-size" is fixed to 100, "tune.vars.reqres-max-size" is fixed to 100. If we create a variable "txn.var" that contains 100 bytes,annot create any more variable in the other contexts.

    .zlib.memlevel 

    the memLevel parameter in zlib initialization for each session. Itnes how much memory should be allocated for the internal compressione. A value of 1 uses minimum memory but is slow and reduces compressiono, a value of 9 uses maximum memory for optimal speed. Can be a value

    ween 1 and 9. The default value is 8.

    .zlib.windowsize 

    the window size (the size of the history buffer) as a parameter of theb initialization for each session. Larger values of this parameter resultetter compression at the expense of memory usage. Can be a value betweend 15. The default value is 15.

    Debugging

    ug

    bles debug mode which dumps to stdout all exchanges, and disables forking background. It is the equivalent of the command-line argument "-d". Itld never be used in a production configuration since it may prevent fullem startup.

    t

    ot display any message during startup. It is equivalent to the command- argument "-q".

    Userlists

    http://users/felipewd/bla.html#3.3-quiethttp://users/felipewd/bla.html#3.3-debughttp://users/felipewd/bla.html#3.2-tune.zlib.windowsizehttp://users/felipewd/bla.html#3.2-tune.zlib.memlevelhttp://users/felipewd/bla.html#tune.vars.reqres-max-sizehttp://users/felipewd/bla.html#tune.vars.txn-max-sizehttp://users/felipewd/bla.html#tune.vars.sess-max-sizehttp://users/felipewd/bla.html#3.2-tune.vars.txn-max-sizehttp://users/felipewd/bla.html#3.2-tune.vars.sess-max-sizehttp://users/felipewd/bla.html#3.2-tune.vars.reqres-max-sizehttp://users/felipewd/bla.html#3.2-tune.vars.global-max-sizehttp://users/felipewd/bla.html#3.2-tune.ssl.ssl-ctx-cache-sizehttp://users/felipewd/bla.html#3.2-tune.ssl.default-dh-paramhttp://users/felipewd/bla.html#3.2-tune.ssl.maxrecordhttp://users/felipewd/bla.html#3.2-tune.ssl.lifetimehttp://users/felipewd/bla.html#3.2-tune.ssl.force-private-cache

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    17/171

    s possible to control access to frontend/backend/listen sections or top stats by allowing only authenticated and authorized users. To do this,s required to create at least one userlist and to define users.

    list 

    ates new userlist with name . Many independent userlists can bed to store authentication & authorization data for independent customers.

    up  [users ,,(...)]

    group to the current userlist. It is also possible toach users to this group by using a comma separated list of nameseeded by "users" keyword.

     [password|insecure-password] [groups ,,(...)]

    user to the current userlist. Both secure (encrypted) and

    cure (unencrypted) passwords can be used. Encrypted passwords areuated using the crypt(3) function so depending of the system'sabilities, different algorithms are supported. For example modern Glibcd Linux system supports MD5, SHA-256, SHA-512 and of course classic,based method of encrypting passwords.

    mple:

    list L1oup G1 users tiger,scottoup G2 users xdb,scott

    er tiger password $6$k6y3o.eP$JlKBx9za9667qe4(...)xHSwRv6J.C0/D7cV91er scott insecure-password elgatoer xdb insecure-password hello

    list L2oup G1oup G2

    er tiger password $6$k6y3o.eP$JlKBx(...)xHSwRv6J.C0/D7cV91 groups G1er scott insecure-password elgato groups G1,G2er xdb insecure-password hello groups G2

    se note that both lists are functionally identical.

    Peers

    s possible to propagate entries of any data-types in stick-tables betweenral haproxy instances over TCP connections in a multi-master fashion. Eachance pushes its local updates and insertions to remote peers. The pushedes overwrite remote ones without aggregation. Interrupted exchanges arematically detected and recovered from the last known point.ddition, during a soft restart, the old process connects to the new oneg such a TCP connection to push all its entries before the new processs to connect to other peers. That ensures very fast replication during a

    ad, it typically takes a fraction of a second even for large tables. that Server IDs are used to identify servers remotely, so it is important configurations look similar or at least that the same IDs are forced on

    h server on all participants.

    ates a new peer list with name . It is an independent section,h is referenced by one or more stick-tables.

    bled

    bles a peers section. It disables both listening and any synchronizationated to this section. This is provided to disable synchronization of stickes without having to comment out all "peers" references.

    ble

    re-enables a disabled peers section which was previously disabled.

     :

    nes a peer inside a peers section.peername> is set to the local peer name (by default hostname, or forcedng "-L" command line option), haproxy will listen for incoming remote peernection on :. Otherwise, : defines where to connect tooin the remote peer, and is used at the protocol level tontify and validate the remote peer on the server side.

    ng a soft restart, local peer : is used by the old instance tonect the new one and initiate a complete replication (teaching process).

    s strongly recommended to have the exact same peers declaration on alls and to only rely on the "-L" command line argument to change the local name. This makes it easier to maintain coherent configuration filesss all peers.

    may want to reference some environment variables in the addressmeter, see section 2.3 about environment variables.

    mple:

    s mypeerspeer haproxy1 192.168.0.1:1024peer haproxy2 192.168.0.2:1024peer haproxy3 10.2.0.1:1024

    kend mybackendmode tcp

    http://users/felipewd/bla.html#2.3http://users/felipewd/bla.html#3.5-peerhttp://users/felipewd/bla.html#3.5-enablehttp://users/felipewd/bla.html#peershttp://users/felipewd/bla.html#3.5-disabledhttp://users/felipewd/bla.html#3.5-peershttp://users/felipewd/bla.html#3.4-grouphttp://users/felipewd/bla.html#3.4-userlist

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    18/171

    balance roundrobinstick-table type ip size 20k peers mypeersstick on src

    server srv1 192.168.0.30:80server srv2 192.168.0.31:80

    Mailers

    s possible to send email alerts when the state of servers changes.onfigured email alerts are sent to each mailer that is configuredmailers section. Email is sent to mailers using SMTP.

    ers 

    ates a new mailer list with the name . It is anpendent section which is referenced by one or more proxies.

    er  :

    nes a mailer inside a mailers section.

    mple:

    ers mymailersmailer smtp1 192.168.0.1:587mailer smtp2 192.168.0.2:587

    kend mybackendmode tcpbalance roundrobin

    email-alert mailers mymailersemail-alert from [email protected] to [email protected]

    server srv1 192.168.0.30:80server srv2 192.168.0.31:80

    Proxies

    xy configuration can be located in a set of sections :efaults []rontend ackend isten

    defaults" section sets default parameters for all other sections followingdeclaration. Those default parameters are reset by the next "defaults"ion. See below for the list of parameters which can be set in a "defaults"ion. The name is optional but its use is encouraged for better readability.

    rontend" section describes a set of listening sockets accepting clientnections.

    ackend" section describes a set of servers to which the proxy will connectorward incoming connections.

    isten" section defines a complete proxy with its frontend and backends combined in one section. It is generally useful for TCP-only traffic.

    proxy names must be formed from upper and lower case letters, digits,(dash), '_' (underscore) , '.' (dot) and ':' (colon). ACL names are-sensitive, which means that "www" and "WWW" are two different proxies.

    orically, all proxy names could overlap, it just caused troubles in the. Since the introduction of content switching, it is mandatory that two

    xies with overlapping capabilities (frontend/backend) have different names.ver, it is still permitted that a frontend and a backend share the same, as this configuration seems to be commonly encountered.

    t now, two major proxy modes are supported : "tcp", also known as layer 4,"http", also known as layer 7. In layer 4 mode, HAProxy simply forwardsrectional traffic between two sides. In layer 7 mode, HAProxy analyzes theocol, and can interact with it by allowing, blocking, switching, adding,fying, or removing arbitrary contents in requests or responses, based ontrary criteria.

    TTP mode, the processing applied to requests and responses flowing overnnection depends in the combination of the frontend's HTTP options andbackend's. HAProxy supports 5 connection modes :

    KAL : keep alive ("option http-keep-alive") which is the default mode : allrequests and responses are processed, and connections remain open but idlebetween responses and new requests.

    TUN: tunnel ("option http-tunnel") : this was the default mode for versions1.0 to 1.5-dev21 : only the first request and response are processed, andeverything else is forwarded with no analysis at all. This mode should notbe used as it creates lots of trouble with logging and HTTP processing.

    PCL: passive close ("option httpclose") : exactly the same as tunnel mode,but with "Connection: close" appended in both directions to try to makeboth ends close after the first request/response exchange.

    SCL: server close ("option http-server-close") : the server-facingconnection is closed after the end of the response is received, but theclient-facing connection remains open.

    FCL: forced close ("option forceclose") : the connection is actively closed

    http://users/felipewd/bla.html#option%20forceclosehttp://users/felipewd/bla.html#option%20http-server-closehttp://users/felipewd/bla.html#option%20httpclosehttp://users/felipewd/bla.html#option%20http-tunnelhttp://users/felipewd/bla.html#option%20http-keep-alivehttp://users/felipewd/bla.html#3.6-mailerhttp://users/felipewd/bla.html#3.6-mailers

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    19/171

    http://users/felipewd/bla.html#4-http-responsehttp://users/felipewd/bla.html#4-http-requesthttp://users/felipewd/bla.html#4-http-check%20send-statehttp://users/felipewd/bla.html#4-http-check%20expecthttp://users/felipewd/bla.html#4-http-check%20disable-on-404http://users/felipewd/bla.html#4-hash-typehttp://users/felipewd/bla.html#4-gracehttp://users/felipewd/bla.html#4-fullconnhttp://users/felipewd/bla.html#4-force-persisthttp://users/felipewd/bla.html#4-errorloc303http://users/felipewd/bla.html#4-errorloc302http://users/felipewd/bla.html#4-errorlochttp://users/felipewd/bla.html#4-errorfilehttp://users/felipewd/bla.html#4-enabledhttp://users/felipewd/bla.html#4-email-alert%20tohttp://users/felipewd/bla.html#4-email-alert%20myhostnamehttp://users/felipewd/bla.html#4-email-alert%20mailershttp://users/felipewd/bla.html#4-email-alert%20levelhttp://users/felipewd/bla.html#4-email-alert%20fromhttp://users/felipewd/bla.html#4-dispatchhttp://users/felipewd/bla.html#4-disabledhttp://users/felipewd/bla.html#4-descriptionhttp://users/felipewd/bla.html#4-default_backendhttp://users/felipewd/bla.html#4-default-serverhttp://users/felipewd/bla.html#4-declare%20capturehttp://users/felipewd/bla.html#4-cookiehttp://users/felipewd/bla.html#4-contimeouthttp://users/felipewd/bla.html#4-compressionhttp://users/felipewd/bla.html#4-clitimeouthttp://users/felipewd/bla.html#4-capture%20response%20headerhttp://users/felipewd/bla.html#4-capture%20request%20headerhttp://users/felipewd/bla.html#4-capture%20cookiehttp://users/felipewd/bla.html#4-blockhttp://users/felipewd/bla.html#4-bind-processhttp://users/felipewd/bla.html#4-balancehttp://users/felipewd/bla.html#4-backloghttp://users/felipewd/bla.html#4-appsession

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    20/171

    http://users/felipewd/bla.html#4-option%20srvtcpkahttp://users/felipewd/bla.html#4-option%20splice-responsehttp://users/felipewd/bla.html#4-option%20splice-requesthttp://users/felipewd/bla.html#4-option%20splice-autohttp://users/felipewd/bla.html#4-option%20socket-statshttp://users/felipewd/bla.html#4-option%20smtpchkhttp://users/felipewd/bla.html#4-option%20redis-checkhttp://users/felipewd/bla.html#4-option%20redispatchhttp://users/felipewd/bla.html#4-option%20prefer-last-serverhttp://users/felipewd/bla.html#4-option%20pgsql-checkhttp://users/felipewd/bla.html#4-option%20persisthttp://users/felipewd/bla.html#4-option%20originaltohttp://users/felipewd/bla.html#4-option%20nolingerhttp://users/felipewd/bla.html#4-option%20mysql-checkhttp://users/felipewd/bla.html#4-option%20logasaphttp://users/felipewd/bla.html#4-option%20log-separate-errorshttp://users/felipewd/bla.html#4-option%20log-health-checkshttp://users/felipewd/bla.html#4-option%20external-checkhttp://users/felipewd/bla.html#4-option%20ldap-checkhttp://users/felipewd/bla.html#4-option%20independent-streamshttp://users/felipewd/bla.html#4-option%20http_proxyhttp://users/felipewd/bla.html#4-option%20httploghttp://users/felipewd/bla.html#4-option%20httpclosehttp://users/felipewd/bla.html#4-option%20httpchkhttp://users/felipewd/bla.html#4-option%20http-use-proxy-headerhttp://users/felipewd/bla.html#4-option%20http-tunnelhttp://users/felipewd/bla.html#4-option%20http-server-closehttp://users/felipewd/bla.html#4-option%20http-pretend-keepalivehttp://users/felipewd/bla.html#4-option%20http-no-delayhttp://users/felipewd/bla.html#4-option%20http-keep-alivehttp://users/felipewd/bla.html#4-option%20http-ignore-probeshttp://users/felipewd/bla.html#4-option%20http-buffer-requesthttp://users/felipewd/bla.html#4-option%20forwardforhttp://users/felipewd/bla.html#4-option%20forceclosehttp://users/felipewd/bla.html#4-option%20dontlognullhttp://users/felipewd/bla.html#4-option%20dontlog-normalhttp://users/felipewd/bla.html#4-option%20contstatshttp://users/felipewd/bla.html#4-option%20clitcpkahttp://users/felipewd/bla.html#4-option%20checkcachehttp://users/felipewd/bla.html#4-option%20allbackupshttp://users/felipewd/bla.html#4-option%20accept-invalid-http-responsehttp://users/felipewd/bla.html#4-option%20accept-invalid-http-requesthttp://users/felipewd/bla.html#4-option%20abortonclosehttp://users/felipewd/bla.html#4-monitor-urihttp://users/felipewd/bla.html#4-monitor-nethttp://users/felipewd/bla.html#4-monitor%20failhttp://users/felipewd/bla.html#4-modehttp://users/felipewd/bla.html#4-maxconnhttp://users/felipewd/bla.html#4-max-keep-alive-queuehttp://users/felipewd/bla.html#4-log-taghttp://users/felipewd/bla.html#4-log-format-sdhttp://users/felipewd/bla.html#4-log-formathttp://users/felipewd/bla.html#4-loghttp://users/felipewd/bla.html#4-load-server-state-from-filehttp://users/felipewd/bla.html#4-ignore-persisthttp://users/felipewd/bla.html#4-http-send-name-headerhttp://users/felipewd/bla.html#4-http-reuse

  • 8/19/2019 HAProxy Version 1.7-Dev1 - Configuration Manual

    21/171

    http://users/felipewd/bla.html#4-tcp-check%20expecthttp://users/felipewd/bla.html#4-tcp-check%20connecthttp://users/felipewd/bla.html#4-stick-tablehttp://users/felipewd/bla.html#4-stick%20store-responsehttp://users/felipewd/bla.html#4-stick%20store-requesthttp://users/felipewd/bla.html#4-stick%20onhttp://users/felipewd/bla.html#4-stick%20matchhttp://users/felipewd/bla.html#4-stats%20urihttp://users/felipewd/bla.html#4-stats%20show-nodehttp://users/felipewd/bla.html#4-stats%20show-legendshttp://users/felipewd/bla.html#4-stats%20show-deschttp://users/felipewd/bla.html#4-stats%20scopehttp://users/felipewd/bla.html#4-stats%20refreshhttp://users/felipewd/bla.html#4-stats%20realmhttp://users/felipewd/bla.html#4-stats%20http-requesthttp://users/felipewd/bla.html#4-stats%20hide-versionhttp://users/felipewd/bla.html#4-stats%20enablehttp://users/felipewd/bla.html#4-stats%20authhttp://users/felipewd/bla.html#4-stats%20adminhttp://users/felipewd/bla.html#4-srvtimeouthttp://users/felipewd/bla.html#4-sourcehttp://users/felipewd/bla.html#4-server-state-file-namehttp://users/felipewd/bla.html#4-serverhttp://users/felipewd/bla.html#4-rsprephttp://users/felipewd/bla.html#4-rspirephttp://users/felipewd/bla.html#4-rspidenyhttp://users/felipewd/bla.html#4-rspidelhttp://users/felipewd/bla.html#4-rspdenyhttp://users/felipewd/bla.html#4-rspdelhttp://users/felipewd/bla.html#4-rspaddhttp://users/felipewd/bla.html#4-retrieshttp://users/felipewd/bla.html#4-reqtarpithttp://users/felipewd/bla.html#4-reqrephttp://users/felipewd/bla.html#4-reqpasshttp://users/felipewd/bla.html#4-reqitarpithttp://users/felipewd/bla.html#4-reqirephttp://users/felipewd/bla.html#4-reqipasshttp://users/felipewd/bla.html#4-reqidenyhttp://users/felipewd/bla.html#4-reqidelhttp://users/felipewd/bla.html#4-reqiallowhttp: