HAProxy Load Balancing: Part Three


Editing the HAProxy pool under pfSense 2.1.5.

In the previous two articles in this series, we introduced HAProxy and began looking at configuration of HAProxy under pfSense. In this article, we conclude our look at HAProxy configuration.

In the HAProxy Listener configuration tab, we had gotten as far as “Balance“. The next setting is “Stats Enabled“, which simply enables the saving of HAProxy statistics. If this check box is checked, 4 additional settings will appear: “Stats Realm“, “Stats Uri“, “Stats Username“, and “Stats Password“. “Stats Realm” is simply the authentication realm. It can be set to anything, although you need to escape space characters with a backslash. “Stats Uri” is the virtual URL to access the stats page. “Username” and “Password” are simply the username/password you want to use.

Moving along to the remaining advanced settings, “Max connections” is the maximum number of allowed connections. “Client timeout” is the time (in milliseconds) HA Proxy will wait for data from the client, or for the client to accept data (default is 30000). The next option is the “Use ‘forwardfor’ option“. This option creates an HTTP ‘X-Forwarded-For’ header which contains the client’s IP address. This is useful to let the final web server know what the client address was. The “Use ‘httpclose’ option” removes any ‘Connection’ header both ways, and adds a ‘Connection: close’ header in each direction. This makes it easier to disable HTTP keep-alive than the previous 4-rules block. Finally, the “Advanced pass thru” text box is for pasting text you would like to pass through.

The final tab is the “Server Pool” tab. Press the “plus” button on the right to add a server. In the “Name” field you can enter any name. For “Cookie“, you need to enter a cookie value, which will be checked in incoming requests. The first operational pool 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. At “Server list“, you can enter a list of servers, press the “plus” button under “Server list” to add a server. At “Check freq“, you can enter the interval at which HAProxy checks the server pool (default is 1000 milliseconds). “Health check URI” allows you to specify the virtual URL to check the health of the server pool (default is “/”). Finally, there is an “Advanced pass thru” text box for text you would like to pass through.

External Links:

The official HAProxy site

HAProxy on Wikipedia

© 2013 David Zientara. All rights reserved. Privacy Policy