5.2. Server and default-server options
- The "server
" and "default-server
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
" keywords support a certain number of settings
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- which are all passed as arguments on the server line. The order in which those
- arguments appear does not count, and they are all optional. Some of those
- settings are single words (booleans) while others expect one or several values
- after them. In this case, the values must immediately follow the setting name.
- Except default-server, all those settings must be specified after the server's
- address if they are used:
- server <name> <address>[:port] [settings ...]
- default-server [settings ...]
- Note that all these settings are supported both by "server
" and "default-server
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- keywords, except "id
" which is only supported by "server
- This keyword is available in sections :
- Alphabetically sorted keywords reference
- Bind options
- Server and default-server options
".
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- The currently supported settings are the following ones.
- Using the "addr" parameter, it becomes possible to use a different IP address
- to send health-checks or to probe the agent-check. On some servers, it may be
- desirable to dedicate an IP address to specific component able to perform
- complex tests which are more suitable to health-checks than the application.
- This parameter is ignored if the "check" parameter is not set. See also the
- "port" parameter.
- Enable an auxiliary agent check which is run independently of a regular
- health check. An agent health check is performed by making a TCP connection
- to the port set by the "agent-port" parameter and reading an ASCII string
- terminated by the first '\r' or '\n' met. The string is made of a series of
- words delimited by spaces, tabs or commas in any order, each consisting of :
- - An ASCII representation of a positive integer percentage, e.g. "75%".
- Values in this format will set the weight proportional to the initial
- weight of a server as configured when haproxy starts. Note that a zero
- weight is reported on the stats page as "DRAIN" since it has the same
- effect on the server (it's removed from the LB farm).
- - The string "maxconn:" followed by an integer (no space between). Values
- in this format will set the maxconn of a server. The maximum number of
- connections advertised needs to be multiplied by the number of load
- balancers and different backends that use this health check to get the
- total number of connections the server might receive. Example: maxconn:30
- - The word "ready". This will turn the server's administrative state to the
- READY mode, thus canceling any DRAIN or MAINT state
- - The word "drain". This will turn the server's administrative state to the
- DRAIN mode, thus it will not accept any new connections other than those
- that are accepted via persistence.
- - The word "maint". This will turn the server's administrative state to the
- MAINT mode, thus it will not accept any new connections at all, and health
- checks will be stopped.
- - The words "down", "failed", or "stopped", optionally followed by a
- description string after a sharp ('#'). All of these mark the server's
- operating state as DOWN, but since the word itself is reported on the stats
- page, the difference allows an administrator to know if the situation was
- expected or not : the service may intentionally be stopped, may appear up
- but fail some validity tests, or may be seen as down (e.g. missing process,
- or port not responding).
- - The word "up" sets back the server's operating state as UP if health checks
- also report that the service is accessible.
- Parameters which are not advertised by the agent are not changed. For
- example, an agent might be designed to monitor CPU usage and only report a
- relative weight and never interact with the operating status. Similarly, an
- agent could be designed as an end-user interface with 3 radio buttons
- allowing an administrator to change only the administrative state. However,
- it is important to consider that only the agent may revert its own actions,
- so if a server is set to DRAIN mode or to DOWN state using the agent, the
- agent must implement the other equivalent actions to bring the service into
- operations again.
- Failure to connect to the agent is not considered an error as connectivity
- is tested by the regular health check which is enabled by the "check"
- parameter. Warning though, it is not a good idea to stop an agent after it
- reports "down", since only an agent reporting "up" will be able to turn the
- server up again. Note that the CLI on the Unix stats socket is also able to
- force an agent's result in order to work around a bogus agent if needed.
- Requires the "agent-port" parameter to be set. See also the "agent-inter"
- and "no-agent-check" parameters.
- If this option is specified, haproxy will send the given string (verbatim)
- to the agent server upon connection. You could, for example, encode
- the backend name into this string, which would enable your agent to send
- different responses based on the backend. Make sure to include a '\n' if
- you want to terminate your request with a newline.
- The "agent-inter" parameter sets the interval between two agent checks
- to <delay> milliseconds. If left unspecified, the delay defaults to 2000 ms.
- Just as with every other time-based parameter, it may be entered in any
- other explicit unit among { us, ms, s, m, h, d }. The "agent-inter"
- parameter also serves as a timeout for agent checks "timeout check" is
- not set. In order to reduce "resonance" effects when multiple servers are
- hosted on the same hardware, the agent and health checks of all servers
- are started with a small time offset between them. It is also possible to
- add some random noise in the agent and health checks interval using the
- global "spread-checks" keyword. This makes sense for instance when a lot
- of backends use the same servers.
- See also the "agent-check" and "agent-port" parameters.
- The "agent-addr" parameter sets address for agent check.
- You can offload agent-check to another target, so you can make single place
- managing status and weights of servers defined in haproxy in case you can't
- make self-aware and self-managing services. You can specify both IP or
- hostname, it will be resolved.
- The "agent-port" parameter sets the TCP port used for agent checks.
- See also the "agent-check" and "agent-inter" parameters.
- Allow sending early data to the server when using TLS 1.3.
- Note that early data will be sent only if the client used early data, or
- if the backend uses "retry-on" with the "0rtt-rejected" keyword.
- This enables the TLS ALPN extension and advertises the specified protocol
- list as supported on top of ALPN. The protocol list consists in a comma-
- delimited list of protocol names, for instance: "http/1.1,http/1.0" (without
- quotes). This requires that the SSL library is built with support for TLS
- extensions enabled (check with haproxy -vv). The ALPN extension replaces the
- initial NPN extension. ALPN is required to connect to HTTP/2 servers.
- Versions of OpenSSL prior to 1.0.2 didn't support ALPN and only supposed the
- now obsolete NPN extension.
- If both HTTP/2 and HTTP/1.1 are expected to be supported, both versions can
- be advertised, in order of preference, like below :
- server 127.0.0.1:443 ssl crt pub.pem alpn h2,http/1.1
- When "backup" is present on a server line, the server is only used in load
- balancing when all other non-backup servers are unavailable. Requests coming
- with a persistence cookie referencing the server will always be served
- though. By default, only the first operational backup server is used, unless
- the "allbackups" option is set in the backend. See also the "no-backup" and
- "allbackups" options.
- This setting is only available when support for OpenSSL was built in. It
- designates a PEM file from which to load CA certificates used to verify
- server's certificate.
- This option enables health checks on the server. By default, a server is
- always considered available. If "check" is set, the server is available when
- accepting periodic TCP connections, to ensure that it is really able to serve
- requests. The default address and port to send the tests to are those of the
- server, and the default source is the same as the one defined in the
- backend. It is possible to change the address using the "addr" parameter, the
- port using the "port" parameter, the source address using the "source
"
- This keyword is available in sections :
- Alphabetically sorted keywords reference
- Server and default-server options
- address, and the interval and timers using the "inter", "rise" and "fall"
- parameters. The request method is define in the backend using the "httpchk",
- "smtpchk", "mysql-check", "pgsql-check" and "ssl-hello-chk" options. Please
- refer to those options and parameters for more information. See also
- "no-check" option.
- This option forces emission of a PROXY protocol line with outgoing health
- checks, regardless of whether the server uses send-proxy or not for the
- normal traffic. By default, the PROXY protocol is enabled for health checks
- if it is already enabled for normal traffic and if no "port" nor "addr"
- directive is present. However, if such a directive is present, the
- "check-send-proxy" option needs to be used to force the use of the
- protocol. See also the "send-proxy" option for more information.
- Defines which protocols to advertise with ALPN. The protocol list consists in
- a comma-delimited list of protocol names, for instance: "http/1.1,http/1.0"
- (without quotes). If it is not set, the server ALPN is used.
- This option allows you to specify the SNI to be used when doing health checks
- over SSL. It is only possible to use a string to set <sni>. If you want to
- set a SNI for proxied traffic, see "sni".
- This option forces encryption of all health checks over SSL, regardless of
- whether the server uses SSL or not for the normal traffic. This is generally
- used when an explicit "port" or "addr" directive is specified and SSL health
- checks are not inherited. It is important to understand that this option
- inserts an SSL transport layer below the checks, so that a simple TCP connect
- check becomes an SSL connect, which replaces the old ssl-hello-chk. The most
- common use is to send HTTPS checks by combining "httpchk" with SSL checks.
- All SSL settings are common to health checks and traffic (e.g. ciphers).
- See the "ssl
" option for more information and "no-check-ssl" to disable
- This keyword is available in sections :
- Bind options
- Server and default-server options
- this option.
- This option enables outgoing health checks using upstream socks4 proxy. By
- default, the health checks won't go through socks tunnel even it was enabled
- for normal traffic.
- This setting is only available when support for OpenSSL was built in. This
- option sets the string describing the list of cipher algorithms that is
- negotiated during the SSL/TLS handshake with the server. The format of the
- string is defined in "man 1 ciphers" from OpenSSL man pages. For background
- information and recommendations see e.g.
- (https://wiki.mozilla.org/Security/Server_Side_TLS) and
- (https://mozilla.github.io/server-side-tls/ssl-config-generator/). For TLSv1.3
- cipher configuration, please check the "ciphersuites
" keyword.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- This setting is only available when support for OpenSSL was built in and
- OpenSSL 1.1.1 or later was used to build HAProxy. This option sets the string
- describing the list of cipher algorithms that is negotiated during the TLS
- 1.3 handshake with the server. The format of the string is defined in
- "man 1 ciphers" from OpenSSL man pages under the "ciphersuites
" section.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- For cipher configuration for TLSv1.2 and earlier, please check the "ciphers
"
- This keyword is available in sections :
- Bind options
- Server and default-server options
- keyword.
- The "cookie
" parameter sets the cookie value assigned to the server to
- This keyword is available in sections :
- Alphabetically sorted keywords reference
- Server and default-server options
- Fetching HTTP samples (Layer 7)
- <value>. This value will be checked in incoming requests, and the first
- operational server possessing the same value will be selected. In return, in
- cookie insertion or rewrite modes, this value will be assigned to the cookie
- sent to the client. There is nothing wrong in having several servers sharing
- the same cookie value, and it is in fact somewhat common between normal and
- backup servers. See also the "cookie
" keyword in backend section.
- This keyword is available in sections :
- Alphabetically sorted keywords reference
- Server and default-server options
- Fetching HTTP samples (Layer 7)
- This setting is only available when support for OpenSSL was built in. It
- designates a PEM file from which to load certificate revocation list used
- to verify server's certificate.
- This setting is only available when support for OpenSSL was built in.
- It designates a PEM file from which to load both a certificate and the
- associated private key. This file can be built by concatenating both PEM
- files into one. This certificate will be sent if the server send a client
- certificate request.
- The "disabled
" keyword starts the server in the "disabled
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- Server and default-server options
" state. That means
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- Server and default-server options
- that it is marked down in maintenance mode, and no connection other than the
- ones allowed by persist mode will reach it. It is very well suited to setup
- new servers, because normal traffic will never reach them, while it is still
- possible to test the service by making use of the force-persist mechanism.
- See also "enabled
" setting.
- This keyword is available in sections :
- Alphabetically sorted keywords reference
- Server and default-server options
- This option may be used as 'server' setting to reset any 'disabled'
- setting which would have been inherited from 'default-server' directive as
- default value.
- It may also be used as 'default-server' setting to reset any previous
- 'default-server' 'disabled' setting.
- If health observing is enabled, the "error-limit" parameter specifies the
- number of consecutive errors that triggers event selected by the "on-error"
- option. By default it is set to 10 consecutive errors.
- See also the "check", "error-limit" and "on-error".
- This option enforces use of SSLv3 only when SSL is used to communicate with
- the server. SSLv3 is generally less expensive than the TLS counterparts for
- high connection rates. This option is also available on global statement
- "ssl-default-server-options". See also "ssl-min-ver
" and ssl-max-ver".
- This keyword is available in sections :
- Bind options
- Server and default-server options
- This option enforces use of TLSv1.0 only when SSL is used to communicate with
- the server. This option is also available on global statement
- "ssl-default-server-options". See also "ssl-min-ver
" and ssl-max-ver".
- This keyword is available in sections :
- Bind options
- Server and default-server options
- This option enforces use of TLSv1.1 only when SSL is used to communicate with
- the server. This option is also available on global statement
- "ssl-default-server-options". See also "ssl-min-ver
" and ssl-max-ver".
- This keyword is available in sections :
- Bind options
- Server and default-server options
- This option enforces use of TLSv1.2 only when SSL is used to communicate with
- the server. This option is also available on global statement
- "ssl-default-server-options". See also "ssl-min-ver
" and ssl-max-ver".
- This keyword is available in sections :
- Bind options
- Server and default-server options
- This option enforces use of TLSv1.3 only when SSL is used to communicate with
- the server. This option is also available on global statement
- "ssl-default-server-options". See also "ssl-min-ver
" and ssl-max-ver".
- This keyword is available in sections :
- Bind options
- Server and default-server options
- Set a persistent ID for the server. This ID must be positive and unique for
- the proxy. An unused ID will automatically be assigned if unset. The first
- assigned value will be 1. This ID is currently only returned in statistics.
init-addr {last | libc | none |
- Indicate in what order the server's address should be resolved upon startup
- if it uses an FQDN. Attempts are made to resolve the address by applying in
- turn each of the methods mentioned in the comma-delimited list. The first
- method which succeeds is used. If the end of the list is reached without
- finding a working method, an error is thrown. Method "last" suggests to pick
- the address which appears in the state file (see "server-state-file"). Method
- "libc" uses the libc's internal resolver (gethostbyname() or getaddrinfo()
- depending on the operating system and build options). Method "none"
- specifically indicates that the server should start without any valid IP
- address in a down state. It can be useful to ignore some DNS issues upon
- startup, waiting for the situation to get fixed later. Finally, an IP address
- (IPv4 or IPv6) may be provided. It can be the currently known address of the
- server (e.g. filled by a configuration generator), or the address of a dummy
- server used to catch old sessions and present them with a decent error
- message for example. When the "first" load balancing algorithm is used, this
- IP address could point to a fake server used to trigger the creation of new
- instances on the fly. This option defaults to "last,libc" indicating that the
- previous address found in the state file (if any) is used first, otherwise
- the libc's resolver is used. This ensures continued compatibility with the
- historic behavior.
Example:
defaults
# never fail on address resolution
default-server init-addr last,libc,none
Server state | Interval used |
---|---|
UP 100% (non-transitional) | “inter“ |
Transitionally UP (going down “fall“), Transitionally DOWN (going up “rise“), or yet unchecked. | “fastinter“ if set, “inter“ otherwise. |
DOWN 100% (non-transitional) | “downinter“ if set, “inter“ otherwise. |
- Just as with every other time-based parameter, they can be entered in any
- other explicit unit among { us, ms, s, m, h, d }. The "inter" parameter also
- serves as a timeout for health checks sent to servers if "timeout check" is
- not set. In order to reduce "resonance" effects when multiple servers are
- hosted on the same hardware, the agent and health checks of all servers
- are started with a small time offset between them. It is also possible to
- add some random noise in the agent and health checks interval using the
- global "spread-checks" keyword. This makes sense for instance when a lot
- of backends use the same servers.
- The "maxconn
" parameter specifies the maximal number of concurrent
- This keyword is available in sections :
- Performance tuning
- Alphabetically sorted keywords reference
- Bind options
- Server and default-server options
- connections that will be sent to this server. If the number of incoming
- concurrent connections goes higher than this value, they will be queued,
- waiting for a slot to be released. This parameter is very important as it can
- save fragile servers from going down under extreme loads. If a "minconn"
- parameter is specified, the limit becomes dynamic. The default value is "0"
- which means unlimited. See also the "minconn" and "maxqueue" parameters, and
- the backend's "fullconn" keyword.
- In HTTP mode this parameter limits the number of concurrent requests instead
- of the number of connections. Multiple requests might be multiplexed over a
- single TCP connection to the server. As an example if you specify a maxconn
- of 50 you might see between 1 and 50 actual server connections, but no more
- than 50 concurrent requests.
- The "maxqueue" parameter specifies the maximal number of connections which
- will wait in the queue for this server. If this limit is reached, next
- requests will be redispatched to other servers instead of indefinitely
- waiting to be served. This will break persistence but may allow people to
- quickly re-log in when the server they try to connect to is dying. The
- default value is "0" which means the queue is unlimited. See also the
- "maxconn
" and "minconn" parameters.
- This keyword is available in sections :
- Performance tuning
- Alphabetically sorted keywords reference
- Bind options
- Server and default-server options
- The "max-reuse" argument indicates the HTTP connection processors that they
- should not reuse a server connection more than this number of times to send
- new requests. Permitted values are -1 (the default), which disables this
- limit, or any positive value. Value zero will effectively disable keep-alive.
- This is only used to work around certain server bugs which cause them to leak
- resources over time. The argument is not necessarily respected by the lower
- layers as there might be technical limitations making it impossible to
- enforce. At least HTTP/2 connections to servers will respect it.
- When the "minconn" parameter is set, the maxconn limit becomes a dynamic
- limit following the backend's load. The server will always accept at least
- <minconn> connections, never more than <maxconn>, and the limit will be on
- the ramp between both values when the backend has less than <fullconn>
- concurrent connections. This makes it possible to limit the load on the
- server during normal loads, but push it further for important loads without
- overloading the server during exceptional loads. See also the "maxconn
"
- This keyword is available in sections :
- Performance tuning
- Alphabetically sorted keywords reference
- Bind options
- Server and default-server options
- and "maxqueue" parameters, as well as the "fullconn" backend keyword.
- On Linux, it is possible to specify which network namespace a socket will
- belong to. This directive makes it possible to explicitly bind a server to
- a namespace different from the default one. Please refer to your operating
- system's documentation to find more details about network namespaces.
- This option may be used as "server
" setting to reset any "agent-check"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "agent-check" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- This option may be used as "server
" setting to reset any "backup"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "backup" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- This option may be used as "server
" setting to reset any "check"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "check" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- This option may be used as "server
" setting to reset any "check-ssl"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "check-ssl" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- This option may be used as "server
" setting to reset any "send-proxy"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "send-proxy" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- This option may be used as "server
" setting to reset any "send-proxy-v2"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "send-proxy-v2" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- This option may be used as "server
" setting to reset any "send-proxy-v2-ssl"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "send-proxy-v2-ssl" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- This option may be used as "server
" setting to reset any "send-proxy-v2-ssl-cn"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "send-proxy-v2-ssl-cn" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- This option may be used as "server
" setting to reset any "ssl
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
"
- This keyword is available in sections :
- Bind options
- Server and default-server options
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "ssl
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
" setting.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- This option disables SSL session reuse when SSL is used to communicate with
- the server. It will force the server to perform a full handshake for every
- new connection. It's probably only useful for benchmarking, troubleshooting,
- and for paranoid users.
- This option disables support for SSLv3 when SSL is used to communicate with
- the server. Note that SSLv2 is disabled in the code and cannot be enabled
- using any configuration option. Use "ssl-min-ver
" and "ssl-max-ver
- This keyword is available in sections :
- Bind options
- Server and default-server options
" instead.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- Supported in default-server: No
- This setting is only available when support for OpenSSL was built in. It
- disables the stateless session resumption (RFC 5077 TLS Ticket
- extension) and force to use stateful session resumption. Stateless
- session resumption is more expensive in CPU usage for servers. This option
- is also available on global statement "ssl-default-server-options".
- The TLS ticket mechanism is only used up to TLS 1.2.
- Forward Secrecy is compromised with TLS tickets, unless ticket keys
- are periodically rotated (via reload or by using "tls-ticket-keys").
- See also "tls-tickets".
- This option disables support for TLSv1.0 when SSL is used to communicate with
- the server. Note that SSLv2 is disabled in the code and cannot be enabled
- using any configuration option. TLSv1 is more expensive than SSLv3 so it
- often makes sense to disable it when communicating with local servers. This
- option is also available on global statement "ssl-default-server-options".
- Use "ssl-min-ver
" and "ssl-max-ver
- This keyword is available in sections :
- Bind options
- Server and default-server options
" instead.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- Supported in default-server: No
- This option disables support for TLSv1.1 when SSL is used to communicate with
- the server. Note that SSLv2 is disabled in the code and cannot be enabled
- using any configuration option. TLSv1 is more expensive than SSLv3 so it
- often makes sense to disable it when communicating with local servers. This
- option is also available on global statement "ssl-default-server-options".
- Use "ssl-min-ver
" and "ssl-max-ver
- This keyword is available in sections :
- Bind options
- Server and default-server options
" instead.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- Supported in default-server: No
- This option disables support for TLSv1.2 when SSL is used to communicate with
- the server. Note that SSLv2 is disabled in the code and cannot be enabled
- using any configuration option. TLSv1 is more expensive than SSLv3 so it
- often makes sense to disable it when communicating with local servers. This
- option is also available on global statement "ssl-default-server-options".
- Use "ssl-min-ver
" and "ssl-max-ver
- This keyword is available in sections :
- Bind options
- Server and default-server options
" instead.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- Supported in default-server: No
- This option disables support for TLSv1.3 when SSL is used to communicate with
- the server. Note that SSLv2 is disabled in the code and cannot be enabled
- using any configuration option. TLSv1 is more expensive than SSLv3 so it
- often makes sense to disable it when communicating with local servers. This
- option is also available on global statement "ssl-default-server-options".
- Use "ssl-min-ver
" and "ssl-max-ver
- This keyword is available in sections :
- Bind options
- Server and default-server options
" instead.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- Supported in default-server: No
- This option may be used as "server
" setting to reset any "verifyhost"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "verifyhost" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- This option may be used as "server
" setting to reset any "tfo
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
"
- This keyword is available in sections :
- Bind options
- Server and default-server options
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "tfo
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
" setting.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- Never add connections allocated to this sever to a stick-table.
- This may be used in conjunction with backup to ensure that
- stick-table persistence is disabled for backup servers.
- This enables the NPN TLS extension and advertises the specified protocol list
- as supported on top of NPN. The protocol list consists in a comma-delimited
- list of protocol names, for instance: "http/1.1,http/1.0" (without quotes).
- This requires that the SSL library is built with support for TLS extensions
- enabled (check with haproxy -vv). Note that the NPN extension has been
- replaced with the ALPN extension (see the "alpn
" keyword), though this one is
- This keyword is available in sections :
- Bind options
- Server and default-server options
- only available starting with OpenSSL 1.0.2.
- This option enables health adjusting based on observing communication with
- the server. By default this functionality is disabled and enabling it also
- requires to enable health checks. There are two supported modes: "layer4" and
- "layer7". In layer4 mode, only successful/unsuccessful tcp connections are
- significant. In layer7, which is only allowed for http proxies, responses
- received from server are verified, like valid/wrong http code, unparsable
- headers, a timeout, etc. Valid status codes include 100 to 499, 501 and 505.
- See also the "check", "on-error" and "error-limit".
- Select what should happen when enough consecutive errors are detected.
- Currently, four modes are available:
- - fastinter: force fastinter
- - fail-check: simulate a failed check, also forces fastinter (default)
- - sudden-death: simulate a pre-fatal failed health check, one more failed
- check will mark a server down, forces fastinter
- - mark-down: mark the server immediately down and force fastinter
- See also the "check", "observe" and "error-limit".
- Modify what occurs when a server is marked down.
- Currently one action is available:
- - shutdown-sessions: Shutdown peer sessions. When this setting is enabled,
- all connections to the server are immediately terminated when the server
- goes down. It might be used if the health check detects more complex cases
- than a simple connection status, and long timeouts would cause the service
- to remain unresponsive for too long a time. For instance, a health check
- might detect that a database is stuck and that there's no chance to reuse
- existing connections anymore. Connections killed this way are logged with
- a 'D' termination code (for "Down").
- Actions are disabled by default
- Modify what occurs when a server is marked up.
- Currently one action is available:
- - shutdown-backup-sessions: Shutdown sessions on all backup servers. This is
- done only if the server is not in backup state and if it is not disabled
- (it must have an effective weight > 0). This can be used sometimes to force
- an active server to take all the traffic back after recovery when dealing
- with long sessions (e.g. LDAP, SQL, ...). Doing this can cause more trouble
- than it tries to solve (e.g. incomplete transactions), so use this feature
- with extreme care. Sessions killed because a server comes up are logged
- with an 'U' termination code (for "Up").
- Actions are disabled by default
- Set the maximum number of idling connections for a server. -1 means unlimited
- connections, 0 means no idle connections. The default is -1. When idle
- connections are enabled, orphaned idle connections which do not belong to any
- client session anymore are moved to a dedicated pool so that they remain
- usable by future clients. This only applies to connections that can be shared
- according to the same principles as those applying to "http-reuse".
- Sets the delay to start purging idle connections. Each <delay> interval, half
- of the idle connections are closed. 0 means we don't keep any idle connection.
- The default is 5s.
- Using the "port" parameter, it becomes possible to use a different port to
- send health-checks. On some servers, it may be desirable to dedicate a port
- to a specific component able to perform complex tests which are more suitable
- to health-checks than the application. It is common to run a simple script in
- inetd for instance. This parameter is ignored if the "check" parameter is not
- set. See also the "addr" parameter.
- Forces the multiplexer's protocol to use for the outgoing connections to this
- server. It must be compatible with the mode of the backend (TCP or HTTP). It
- must also be usable on the backend side. The list of available protocols is
- reported in haproxy -vv.
- Idea behind this optipon is to bypass the selection of the best multiplexer's
- protocol for all connections established to this server.
- The "redir" parameter enables the redirection mode for all GET and HEAD
- requests addressing this server. This means that instead of having HAProxy
- forward the request to the server, it will send an "HTTP 302" response with
- the "Location" header composed of this prefix immediately followed by the
- requested URI beginning at the leading '/' of the path component. That means
- that no trailing slash should be used after <prefix>. All invalid requests
- will be rejected, and all non-GET or HEAD requests will be normally served by
- the server. Note that since the response is completely forged, no header
- mangling nor cookie insertion is possible in the response. However, cookies in
- requests are still analyzed, making this solution completely usable to direct
- users to a remote location in case of local disaster. Main use consists in
- increasing bandwidth for static servers by having the clients directly
- connect to them. Note: never use a relative location here, it would cause a
- loop between the client and HAProxy!
Example :
server srv1 192.168.1.1:80 redir http://image1.mydomain.com check
- Comma separated list of options to apply to DNS resolution linked to this
- server.
- Available options:
- * allow-dup-ip
- By default, HAProxy prevents IP address duplication in a backend when DNS
- resolution at runtime is in operation.
- That said, for some cases, it makes sense that two servers (in the same
- backend, being resolved by the same FQDN) have the same IP address.
- For such case, simply enable this option.
- This is the opposite of prevent-dup-ip.
- * prevent-dup-ip
- Ensure HAProxy's default behavior is enforced on a server: prevent re-using
- an IP address already set to a server in the same backend and sharing the
- same fqdn.
- This is the opposite of allow-dup-ip.
Example:
backend b_myapp
default-server init-addr none resolvers dns
server s1 myapp.example.com:80 check resolve-opts allow-dup-ip
server s2 myapp.example.com:81 check resolve-opts allow-dup-ip
- With the option allow-dup-ip set:
- * if the nameserver returns a single IP address, then both servers will use
- it
- * If the nameserver returns 2 IP addresses, then each server will pick up a
- different address
- Default value: not set
- When DNS resolution is enabled for a server and multiple IP addresses from
- different families are returned, HAProxy will prefer using an IP address
- from the family mentioned in the "resolve-prefer" parameter.
- Available families: "ipv4" and "ipv6"
- Default value: ipv6
Example:
server s1 app1.domain.com:80 resolvers mydns resolve-prefer ipv6
resolve-net
- This option prioritizes the choice of an ip address matching a network. This is
- useful with clouds to prefer a local ip. In some cases, a cloud high
- availability service can be announced with many ip addresses on many
- different datacenters. The latency between datacenter is not negligible, so
- this patch permits to prefer a local datacenter. If no address matches the
- configured network, another address is selected.
Example:
server s1 app1.domain.com:80 resolvers mydns resolve-net 10.0.0.0/8
- Points to an existing "resolvers
" section to resolve current server's
- This keyword is available in sections :
- Server and default-server options
- The resolvers section
- hostname.
Example:
server s1 app1.domain.com:80 check resolvers mydns
- See also section 5.3
- The "send-proxy" parameter enforces use of the PROXY protocol over any
- connection established to this server. The PROXY protocol informs the other
- end about the layer 3/4 addresses of the incoming connection, so that it can
- know the client's address or the public address it accessed to, whatever the
- upper layer protocol. For connections accepted by an "accept-proxy" or
- "accept-netscaler-cip" listener, the advertised address will be used. Only
- TCPv4 and TCPv6 address families are supported. Other families such as
- Unix sockets, will report an UNKNOWN family. Servers using this option can
- fully be chained to another instance of haproxy listening with an
- "accept-proxy" setting. This setting must not be used if the server isn't
- aware of the protocol. When health checks are sent to the server, the PROXY
- protocol is automatically used when this option is set, unless there is an
- explicit "port" or "addr" directive, in which case an explicit
- "check-send-proxy" directive would also be needed to use the PROXY protocol.
- See also the "no-send-proxy" option of this section and "accept-proxy" and
- "accept-netscaler-cip" option of the "bind
" keyword.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- The "send-proxy-v2" parameter enforces use of the PROXY protocol version 2
- over any connection established to this server. The PROXY protocol informs
- the other end about the layer 3/4 addresses of the incoming connection, so
- that it can know the client's address or the public address it accessed to,
- whatever the upper layer protocol. It also send ALPN information if an alpn
- have been negotiated. This setting must not be used if the server isn't aware
- of this version of the protocol. See also the "no-send-proxy-v2" option of
- this section and send-proxy" option of the "bind
" keyword.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- The "proxy-v2-options" parameter add option to send in PROXY protocol version
- 2 when "send-proxy-v2" is used. Options available are "ssl
" (see also
- This keyword is available in sections :
- Bind options
- Server and default-server options
- send-proxy-v2-ssl), "cert-cn" (see also "send-proxy-v2-ssl-cn"), "ssl-cipher":
- name of the used cipher, "cert-sig": signature algorithm of the used
- certificate, "cert-key": key algorithm of the used certificate), "authority":
- host name value passed by the client (only sni from a tls connection is
- supported), "crc32c": checksum of the proxy protocol v2 header.
- The "send-proxy-v2-ssl" parameter enforces use of the PROXY protocol version
- 2 over any connection established to this server. The PROXY protocol informs
- the other end about the layer 3/4 addresses of the incoming connection, so
- that it can know the client's address or the public address it accessed to,
- whatever the upper layer protocol. In addition, the SSL information extension
- of the PROXY protocol is added to the PROXY protocol header. This setting
- must not be used if the server isn't aware of this version of the protocol.
- See also the "no-send-proxy-v2-ssl" option of this section and the
- "send-proxy-v2" option of the "bind
" keyword.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- The "send-proxy-v2-ssl" parameter enforces use of the PROXY protocol version
- 2 over any connection established to this server. The PROXY protocol informs
- the other end about the layer 3/4 addresses of the incoming connection, so
- that it can know the client's address or the public address it accessed to,
- whatever the upper layer protocol. In addition, the SSL information extension
- of the PROXY protocol, along along with the Common Name from the subject of
- the client certificate (if any), is added to the PROXY protocol header. This
- setting must not be used if the server isn't aware of this version of the
- protocol. See also the "no-send-proxy-v2-ssl-cn" option of this section and
- the "send-proxy-v2" option of the "bind
" keyword.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- The "slowstart" parameter for a server accepts a value in milliseconds which
- indicates after how long a server which has just come back up will run at
- full speed. Just as with every other time-based parameter, it can be entered
- in any other explicit unit among { us, ms, s, m, h, d }. The speed grows
- linearly from 0 to 100% during this time. The limitation applies to two
- parameters :
- - maxconn: the number of connections accepted by the server will grow from 1
- to 100% of the usual dynamic limit defined by (minconn,maxconn,fullconn).
- - weight: when the backend uses a dynamic weighted algorithm, the weight
- grows linearly from 1 to 100%. In this case, the weight is updated at every
- health-check. For this reason, it is important that the "inter" parameter
- is smaller than the "slowstart", in order to maximize the number of steps.
- The slowstart never applies when haproxy starts, otherwise it would cause
- trouble to running servers. It only applies when a server has been previously
- seen as failed.
- The "sni" parameter evaluates the sample fetch expression, converts it to a
- string and uses the result as the host name sent in the SNI TLS extension to
- the server. A typical use case is to send the SNI received from the client in
- a bridged HTTPS scenario, using the "ssl_fc_sni" sample fetch for the
- expression, though alternatives such as req.hdr(host) can also make sense. If
- "verify required" is set (which is the recommended setting), the resulting
- name will also be matched against the server certificate's names. See the
- "verify
" directive for more details. If you want to set a SNI for health
- This keyword is available in sections :
- Bind options
- Server and default-server options
- checks, see the "check-sni" directive for more details.
source
source
source
- The "source
" parameter sets the source address which will be used when
- This keyword is available in sections :
- Alphabetically sorted keywords reference
- Server and default-server options
- connecting to the server. It follows the exact same parameters and principle
- as the backend "source
" keyword, except that it only applies to the server
- This keyword is available in sections :
- Alphabetically sorted keywords reference
- Server and default-server options
- referencing it. Please consult the "source
" keyword for details.
- This keyword is available in sections :
- Alphabetically sorted keywords reference
- Server and default-server options
- Additionally, the "source
" statement on a server line allows one to specify a
- This keyword is available in sections :
- Alphabetically sorted keywords reference
- Server and default-server options
- source port range by indicating the lower and higher bounds delimited by a
- dash ('-'). Some operating systems might require a valid IP address when a
- source port range is specified. It is permitted to have the same IP/range for
- several servers. Doing so makes it possible to bypass the maximum of 64k
- total concurrent connections. The limit will then reach 64k connections per
- server.
- Since Linux 4.2/libc 2.23 IP_BIND_ADDRESS_NO_PORT is set for connections
- specifying the source address without port(s).
- This option enables SSL ciphering on outgoing connections to the server. It
- is critical to verify server certificates using "verify
" when using SSL to
- This keyword is available in sections :
- Bind options
- Server and default-server options
- connect to servers, otherwise the communication is prone to trivial man in
- the-middle attacks rendering SSL useless. When this option is used, health
- checks are automatically sent in SSL too unless there is a "port" or an
- "addr" directive indicating the check should be sent to a different location.
- See the "no-ssl" to disable "ssl
" option and "check-ssl" option to force
- This keyword is available in sections :
- Bind options
- Server and default-server options
- SSL health checks.
ssl-max-ver [ SSLv3 | TLSv1.0 | TLSv1.1 | TLSv1.2 | TLSv1.3 ]
- This option enforces use of <version> or lower when SSL is used to communicate
- with the server. This option is also available on global statement
- "ssl-default-server-options". See also "ssl-min-ver
".
- This keyword is available in sections :
- Bind options
- Server and default-server options
ssl-min-ver [ SSLv3 | TLSv1.0 | TLSv1.1 | TLSv1.2 | TLSv1.3 ]
- This option enforces use of <version> or upper when SSL is used to communicate
- with the server. This option is also available on global statement
- "ssl-default-server-options". See also "ssl-max-ver
".
- This keyword is available in sections :
- Bind options
- Server and default-server options
- This option may be used as "server
" setting to reset any "no-ssl-reuse"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "no-ssl-reuse" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- This option may be used as "server
" setting to reset any "non-stick"
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "non-stick" setting.
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
socks4
- This option enables upstream socks4 tunnel for outgoing connections to the
- server. Using this option won't force the health check to go via socks4 by
- default. You will have to use the keyword "check-via-socks4" to enable it.
- Sets the TCP User Timeout for all outgoing connections to this server. This
- option is available on Linux since version 2.6.37. It allows haproxy to
- configure a timeout for sockets which contain data not receiving an
- acknowledgment for the configured delay. This is especially useful on
- long-lived connections experiencing long idle periods such as remote
- terminals or database connection pools, where the client and server timeouts
- must remain high to allow a long period of idle, but where it is important to
- detect that the server has disappeared in order to release all resources
- associated with its connection (and the client's session). One typical use
- case is also to force dead server connections to die when health checks are
- too slow or during a soft reload since health checks are then disabled. The
- argument is a delay expressed in milliseconds by default. This only works for
- regular TCP connections, and is ignored for other protocols.
- This option enables using TCP fast open when connecting to servers, on
- systems that support it (currently only the Linux kernel >= 4.11).
- See the "tfo
" bind option for more information about TCP fast open.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- Please note that when using tfo, you should also use the "conn-failure",
- "empty-response" and "response-timeout" keywords for "retry-on", or haproxy
- won't be able to retry the connection on failure. See also "no-tfo".
track [
- This option enables ability to set the current state of the server by tracking
- another one. It is possible to track a server which itself tracks another
- server, provided that at the end of the chain, a server has health checks
- enabled. If <proxy> is omitted the current one is used. If disable-on-404 is
- used, it has to be enabled on both proxies.
- This option may be used as "server
" setting to reset any "no-tls-tickets
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
"
- This keyword is available in sections :
- Bind options
- Server and default-server options
- setting which would have been inherited from "default-server
" directive as
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- default value.
- The TLS ticket mechanism is only used up to TLS 1.2.
- Forward Secrecy is compromised with TLS tickets, unless ticket keys
- are periodically rotated (via reload or by using "tls-ticket-keys").
- It may also be used as "default-server
" setting to reset any previous
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
- "default-server
" "no-tls-tickets
- This keyword is available in sections :
- Peers
- Alphabetically sorted keywords reference
" setting.
- This keyword is available in sections :
- Bind options
- Server and default-server options
verify [none|required]
- This setting is only available when support for OpenSSL was built in. If set
- to 'none', server certificate is not verified. In the other case, The
- certificate provided by the server is verified using CAs from 'ca-file' and
- optional CRLs from 'crl-file' after having checked that the names provided in
- the certificate's subject and subjectAlternateNames attributes match either
- the name passed using the "sni" directive, or if not provided, the static
- host name passed using the "verifyhost" directive. When no name is found, the
- certificate's names are ignored. For this reason, without SNI it's important
- to use "verifyhost". On verification failure the handshake is aborted. It is
- critically important to verify server certificates when using SSL to connect
- to servers, otherwise the communication is prone to trivial man-in-the-middle
- attacks rendering SSL totally useless. Unless "ssl_server_verify" appears in
- the global section, "verify
" is set to "required" by default.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- This setting is only available when support for OpenSSL was built in, and
- only takes effect if 'verify required' is also specified. This directive sets
- a default static hostname to check the server's certificate against when no
- SNI was used to connect to the server. If SNI is not used, this is the only
- way to enable hostname verification. This static hostname, when set, will
- also be used for health checks (which cannot provide an SNI value). If none
- of the hostnames in the certificate match the specified hostname, the
- handshake is aborted. The hostnames in the server-provided certificate may
- include wildcards. See also "verify
", "sni" and "no-verifyhost" options.
- This keyword is available in sections :
- Bind options
- Server and default-server options
- The "weight" parameter is used to adjust the server's weight relative to
- other servers. All servers will receive a load proportional to their weight
- relative to the sum of all weights, so the higher the weight, the higher the
- load. The default weight is 1, and the maximal value is 256. A value of 0
- means the server will not participate in load-balancing but will still accept
- persistent connections. If this parameter is used to distribute the load
- according to server's capacity, it is recommended to start with values which
- can both grow and shrink, for instance between 10 and 100 to leave enough
- room above and below for later adjustments.