HAProxy Enterprise Documentation 2.2r1

Installation

Install the Update module as follows for your platform:

$ # On Debian/Ubuntu
$ sudo apt-get install hapee-2.2r1-lb-update
$ # On CentOS/RedHat/Oracle/Photon OS
$ sudo yum install hapee-2.2r1-lb-update
$ # On SUSE
$ sudo zypper install hapee-2.2r1-lb-update
$ # On FreeBSD
$ sudo pkg install hapee-2.2r1-lb-update

Configuration

  1. In the global section of your configuration file, add a module-load directive to load the Update module:

    global
       module-load hapee-lb-update.so
  2. Below the global section, add a new configuration section named dynamic-update. Inside, add one or more update lines that specify from where and how often to download new content. Here is an example that updates the contents of a file at /etc/hapee-2.2/redirects.map from the URL http://10.0.0.1:80/redirects.map:

    dynamic-update
       update id /etc/hapee-2.2/redirects.map map url http://10.0.0.1:80/redirects.map delay 300s

    As an example, the contents of this file could be a list of IP subnets and URL paths to redirect clients to if their IP address falls within one of the ranges:

    10.0.0.0/8     /maint/maintenance.html
    192.168.0.0/16 /maint/forbidden.html
    0.0.0.0/0        /maint/deny.html

    In the following snippet, a frontend references this data using an acl directive and an http-request redirect directive:

    frontend fe_main
       mode http
       bind :80
       acl redirect_needed src,map_ip(/etc/hapee-2.2/redirects.map) -m found
       acl redirect_performed path_beg /maint/
       http-request redirect location %[src,map_ip(/etc/hapee-2.2/redirects.map)] if redirect_needed !redirect_performed

If you do not reference the file you specify in dynamic-update for use in another configuration section, the service will log an error similar to the following:

[ALERT]    (1525) : config : 'update': id '/redirects.map' not found in file ./haproxy.cfg at line 22
[ALERT]    (1525) : config : Fatal errors found in configuration.

Next up

TLS session ticket keys