Various methods can be used to balance connections from users across multiple MultiPortal nodes.
This is used primarily for redundancy, so the failure of a single node does not prevent users from communicating with MultiPortal as users are automatically redirected to healthy nodes.
One tested load balancing method is using a Linux-based HAProxy server
Below are high level steps for configuration of HAProxy to be placed in front of MultiPortal nodes.
Step 1: Install the Operating System
First, ensure you have either Ubuntu or Debian installed on your machine. If you haven't done this yet, download the OS from their official websites and complete the installation process.
Step 2: Get the HAProxy Installation Commands
Visit haproxy.debian.net and fill out the form with your OS version and desired HAProxy version. This will generate custom installation commands for you.
Step 3: Install HAProxy
Follow the step-by-step instructions provided on the HAProxy site to install it on your system.
Step 4: Configure HAProxy
/etc/haproxy/haproxy.cfg
Note: Using the provided example configuration, HAProxy will operate in SSL passthrough mode, meaning HAProxy does not have it's own SSL certificate and simply passes web requests onto a MultiPortal node. As such, it is recommended to use a DNS record to connect to HAProxy, and ensure all nodes have the an SSL certificate installed that matches this hostname, to avoid certificate mismatch issues
Step 5: Save and Restart HAProxy
After making the changes, save the configuration file and restart the HAProxy service to apply the new settings:
sudo systemctl restart haproxy
And that’s it! HAProxy is now configured and ready to manage traffic for your MultiPortal nodes.