As said before, to be able to access your background servers, you need to add a front-end server in HAProxy.
It is this server that external clients (present on the Internet or having access to the pfSense WAN interface) will access.
To do this, go to the "Frontend" tab of pfSense and click on: Add.
On the "Edit HAProxy Frontend" page that appears, configure these settings:
In the "Default Backend, access control lists and actions" section, select the backend server pool to use by default.
In our case, we select "Default Backend: WebServers".
In the "Advanced settings" section, configure these settings:
Click Save.
Click Apply Changes.
Your front end server appears with:
To configure HAProxy settings and enable this HAProxy service, go to: Services -> HAProxy.
In the "General settings" section, check the "Enable HAProxy" box to enable HAProxy and specify the maximum number of connections managed simultaneously per process.
In our case: 1000.
Note that the higher the number of maximum connections, the more memory will be used. (See table displayed by pfSense.)
In the "Stats tab, 'internal' stats port" section, indicate the port that will be used for HAProxy statistics.
Default: 2200.
At the bottom of the page, click Save.
Click: Apply Changes.
Plain Text
The haproxy configuration has been changed. You must apply the changes in order for them to take effect.
To make your front-end server accessible from the outside (pfSense WAN interface), you need to add a rule in the pfSense firewall.
To do this, go to: Firewall -> Rules.
In the "WAN" tab, click: Add.
Configure the rule like this:
Then, configure this:
Click Save.
Click: Apply Changes.
The rule has been created.
In our case, the WAN IP address of pfSense is "192.168.1.10".
According to information from Netgate, to test load balancing via the front-end server, open a web browser in private browsing and type the address of the front-end web server.
In our case, we arrive at our first web server.
Then press F5 several times and you will see that you will access server 2.
The choice is made randomly each time you attempt to access the HAProxy front-end web server.
To view HAProxy statistics, go to: Services -> HAProxy.
Go to the "Stats" tab.
Thanks to this report, you will be able to see the status of the web servers located in the background (backend).
Source : Server Load Balancing on pfSense 2.4 - pfSense Hangout July 2017 (pages 14 to 17).
Firewall 9/19/2025
Firewall 5/28/2025
Firewall 7/2/2025
Firewall 8/29/2025
Pinned content
Contact
® InformatiWeb-Pro.net - InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.
Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.
No comment