Custom load balancing rules

Last updated Sep 10, 2026 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 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.

Custom rules can override Geo steering pool mappings for matched requests. Specify different region, country, or data center pools in the rule. Changing only the steering policy does not disable Geo steering. Cloudflare still resolves pools from the configured topology before applying that policy.

Custom rules do work alongside pool sets. Cloudflare evaluates pool sets first, then applies custom rule overrides on top of the result. A pool set that returns a fixed response is the complete response, so custom rules are not evaluated for that request.

Was this helpful?

YesNo

On this page

Custom load balancing rules - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/load-balancing/additional-options/load-balancing-rules/#page","headline":"Custom load balancing rules","description":"Customize load balancing behavior with custom rules.","url":"https://developers.cloudflare.com/load-balancing/additional-options/load-balancing-rules/","inLanguage":"en","image":"https://developers.cloudflare.com/load-balancing/additional-options/load-balancing-rules/og.png?v=33f67aec88fab869","dateModified":"2026-09-10","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Actions available in custom load balancing rules. title: Actions image: https://developers.cloudflare.com/load-balancing/additional-options/load-balancing-rules/actions/og.png?v=cf508f5bb5f495fe


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/load-balancing/llms.txt
Use this file to discover all available pages before exploring further.