There are certain circumstances in which you might want to transparently pass traffic from one port to another. Quite typically for web apps, this may be the case if you are receiving plain text insecure requests on port 80 (HTTP) and you want those to be redirected to an SSL-secured connection on port 443 (HTTPS).
This HTTP to HTTPS redirection is something you can easily achieve with a Balancer group/frontend.
Step 1: Setup the Group
We will create an HTTP-Servers group and set it to listen on port 80.
Balancer > Group Management
Click on the Add a Group tab, and enter your group details.
Give it a Name (e.g. HTTP-Servers) and set it to listen on Port Number 80.
Click on the Step 2 button at the bottom of the page.
Step 2: Set the Balance Method and Mode
Now it is time to configure the options for your HTTP-Servers group. You can edit these at a later stage, but take note of the various options and features as they can dramatically effect your balance group!
Standard Options sub-tab > Balance Options pane
Set Balance Method to Round-Robin, and set Balance Mode to HTTP (Layer 7).
Note: in Round-Robin balance method, each server is used in turns, according to their weights. This is the smoothest and fairest algorithm when the server’s processing time remains equally distributed. This algorithm is dynamic, which means that server weights may be adjusted on the fly for slow starts, for instance.
Step 3: Set the Redirects
We’ll now properly set the redirects from the HTTP to HTTPS schema.
HTTP Options tab > Header Modification pane
And set Redirects to:
Click on the Save button at the end of the page.
… and that’s it! You have redirected all traffic from port 80 (HTTP) to port 443 (HTTPS).