2.3. Environment variables
- HAProxy's configuration supports environment variables. Those variables are
- interpreted only within double quotes. Variables are expanded during the
- configuration parsing. Variable names must be preceded by a dollar ("$") and
- optionally enclosed with braces ("{}") similarly to what is done in Bourne
- shell. Variable names can contain alphanumerical characters or the character
- underscore ("_") but should not start with a digit.
Example:
bind "fd@${FD_APP1}"
log "${LOCAL_SYSLOG}:514" local0 notice # send to local server
user "$HAPROXY_USER"
- Some variables are defined by HAProxy, they can be used in the configuration
- file, or could be inherited by a program (See 3.7. Programs):
- * HAPROXY_LOCALPEER: defined at the startup of the process which contains the
- name of the local peer. (See "-L" in the management guide.)
- * HAPROXY_CFGFILES: list of the configuration files loaded by HAProxy,
- separated by semicolons. Can be useful in the case you specified a
- directory.
- * HAPROXY_MWORKER: In master-worker mode, this variable is set to 1.
- * HAPROXY_CLI: configured listeners addresses of the stats socket for every
- processes, separated by semicolons.
- * HAPROXY_MASTER_CLI: In master-worker mode, listeners addresses of the master
- CLI, separated by semicolons.
- See also "external-check command" for other variables.