Create a Cloudflare load balancer in the dashboard
- Access to Load Balancing:
- A Cloudflare Enterprise plan with Load Balancing enabled
- An existing Free, Pro, or Business plan with a Load Balancing subscription
- Load balancer hostname: The hostname for which the Cloudflare Load Balancer will manage traffic. The default hostname is the root hostname.
- Location: This walkthrough configures only a single geographic region.
1. Create a load balancer
Log in to your Cloudflare account and select a domain.
Go to Traffic > Load Balancing.
Select Create a Load Balancer.
In the Hostname page, enter a hostname (the DNS name at which the load balancer is available).
2. Create and add origin pools
On the Add an Origin Pool page, select Create an origin pool.
Enter the following information for each origin:
On the origin pool, update the following information:
- Health Threshold: Number of healthy origins for the pool as a whole to be considered Healthy and receive traffic based on pool order in a load balancer
- Notifications: If you do or do not want to receive notifications when the pool's status changes
When finished, select Save.
Create additional pools as needed by repeating the previous steps.
3. Create, attach, and configure monitors
A. Create a monitor to attach to an origin pool
On a pool, select Attach monitor.
Select Create a Monitor.
Add the following information:
Type: The protocol to use for health checks (HTTP, HTTPS, or TCP)
Path: The endpoint path to run health checks against
Port: The destination port for health checks
For additional settings, select Advanced health check settings:
- Simulate Zone:
- Emulates the specified zone while probing
- Pushes a request from Cloudflare Health Monitors through the Cloudflare stack as if it were a real visitor request to help analyze behavior or validate a configuration
- Can support authenticated origin pulls by entering the appropriate zone in the Simulate Zone field of the UI
- Simulate Zone:
B. Configure the monitor
To configure the monitor, enter the following information:
Health Threshold: Defines the number of healthy origin servers required to consider the pool healthy. When the number of healthy origin servers drops below this threshold, the pool will be marked unhealthy.
Health Check Regions: Specifies geographic regions from which Cloudflare should send health check requests.
Notification E-mail: Contains email addresses that receive notifications (individual, mailing list address, PagerDuty address).
Select Save. The status of your health check will be unknown until the results of the first check are available.
4. Configure Traffic Steering
Select Next to continue.
5. Create custom Load Balancing rules
6. Review your load balancer configuration
Before creating your load balancer, check the Review Summary and make changes as needed.
Then, choose how you want to save your changes:
- Save and Deploy commits the configuration and immediately starts your load balancer
- Save as Draft commits your configuration without starting the load balancer
7. Share your load balancer with other sites (optional)
You can share your load balancer with other sites in your account by creating a canonical name (CNAME) record in the Cloudflare DNS app. This is useful for sharing configurations with multiple other domains, and you do not have to create new load balancers for each site.
You can also configure separate load balancers for each domain and reuse monitors and pools. This is especially useful for changing the failover order for different domains, such as when your example.co.uk server has a different failover priority from example.com or example.com.au.
Deleting load balancers, pools, and monitors
To delete a load balancer, select Delete on the associated balancer.
However, deleting a Load Balancer does not delete associated pools and monitors. To delete pools and monitors in the Cloudflare dashboard, use the Manage Pools and Manage Monitors buttons within the Traffic app, in the Load Balancing tab.