Cloudflare Docs
Load Balancing
Load Balancing
Edit this page
Give us feedback
Set theme to dark (⇧+D)

Custom rules

Custom load balancing rules let you customize the behavior of your load balancer based on the characteristics of a request.

For example, you can use URL-based routing, or create a rule that selects a pool based on the URI path of an HTTP request.

​​ How custom rules work

As with WAF custom rules, each load balancing custom rule is a combination of two elements: an expression and an action. Expressions define the criteria for an HTTP request to trigger an action. The action tells Cloudflare how to handle the request.

You can create Load Balancing rules whenever you create or edit a load balancer in Traffic > Load Balancing.

When building expressions for Load Balancing rules, refer to Supported fields and operators for definitions and usage.

​​ Availability

By default, non-Enterprise customers have one Load Balancing rule per load balancer hostname. For more rules, upgrade to Enterprise.

​​ Limitations

At the moment, you cannot use Load Balancing rules with Cloudflare Spectrum.