Frontend
Load balancer frontends define how to listen for traffic coming from outside; and to which route (or backend) it should be sent to. You can add multiple frontends to your load balancer, and you can also use conditions to route traffic to the correct place in the same frontend.
Create or Edit a Frontend
Navigate to the Frontend Creation tab
From your load balancer's overview page, click on the "Frontends" tab, then click the "Create" button.
Basic Information
Fill in the basic information for your frontend.
- Name: Give your frontend a name.
- Port: The frontend will listen for traffic on this port.
- Mode: Choose between "HTTP" and "TCP" mode, use "HTTP" if you need control over HTTP parameters like path, headers, etc, otherwise "TCP" would be fast and efficient.
Warning
Frontends and backends must have the same "mode"
Forward Client Real IP Address
Activated by default, this writes the client's real IP address, port and protocol to X-Forwarded-For
, X-Forwarded-Port
and X-Forwarded-Proto
headers,
which can be crucial for your application.
Note
This is useful for applications that need to know the client's real IP address, port and protocol.
Bind Ports
Your frontend can listen on multiple ports (for example, 80 and 443 for HTTP and HTTPS), you may also specify SSL certificates for TLS termination (feature coming soon).
Conditions (ACLs)
You can add conditions to your frontend to route traffic to the correct place.
For example, you can route traffic based on subdomain using Host
header. Example:
- Host equals "api.mydomain.com" -> route to "my-api-backend"
- And "auth.mydomain.com" -> route to "my-auth-backend".
Or based on path (using
Path
condition). Example: - Path begins with "/v0.1/"
Work in Progress
Support for more conditions and the ability to combine multiple conditions using "AND" and "OR" operators will be added soon.
Backend Switching Rules
This section enables you to choose which backend to use based on the conditions you defined.
Work in Progress
Support for complex conditions coming soon.
Next Steps
Sample App
Deploy a sample app on your load balancer to see it in action