Create load balancer on test domain
Instead of starting on your production domain, you likely should create a load balancer on a test or staging domain. This may involve temporary changes to your monitors and pools, depending on your infrastructure setup.
Starting with a test domain allows you to verify everything is working correctly before routing production traffic.
To create a load balancer in the dashboard:
-
Go to Traffic > Load Balancing.
-
Select Create Load Balancer.
-
On the Hostname page:
- Enter a Hostname, which is the DNS name at which the load balancer is available. For more details on record priority, refer to DNS records for load balancing.
- Toggle the orange cloud icon to update the proxy mode, which affects how traffic is routed and which IP addresses are advertised.
- If you want session-based load balancing, toggle the Session Affinity switch.
-
Select Next.
-
On the Add a Pool page:
- Select one or more existing pools or create a new pool.
- If you are going to set traffic steering to Off, re-order the pools in your load balancer to adjust the fallback order.
- If needed, update the Fallback Pool.
- If you choose to set traffic steering to Random, you can set Weights (via the API) to your pools to determine the percentage of traffic sent to each pool.
-
Select Next.
-
On the Monitors page:
- Review the monitors attached to your pools.
- If needed, you can attach an existing monitor or create a new monitor.
-
Select Next.
-
On the Traffic Steering page, choose an option for Traffic steering and select Next.
-
On the Custom Rules page, select an existing rule or create a new rule.
-
Select Next.
-
On the Review page:
- Review your configuration and make any changes.
- Choose whether to Save as Draft or Save and Deploy.
For a full list of properties, refer to Create Load Balancer. If you need help with API authentication, refer to Cloudflare API documentation.
The response contains the complete definition of the new load balancer.