Skip to content
Load Balancing
Visit Load Balancing on GitHub
Set theme to dark (⇧+D)

Supported fields and operators


Load Balancing expressions support these fields:

Name in Expression BuilderFieldDescription
HTTP versionhttp.request.version

The version of the HTTP protocol used. Use this field when you require different checks for different versions.

Example Values:

  • HTTP/1.1
  • HTTP/3

IP addressip.src
IP address

The client TCP IP address, which may be adjusted to reflect the actual address of the client by using, for example, HTTP headers such asX-Forwarded-For or X-Real-IP.

Example value:


The absolute URI of the request.

Example value:

URI pathhttp.request.uri.path

The URI path of the request.

Example value:

URI query stringhttp.request.uri.query

The entire query string for the request, without the ? delimiter.

Example value:



Comparison operators specify how values defined in an expression must relate to the actual HTTP request value for the expression to return true.

Logical operators combine two expressions to form a compound expression and use order of precedence to determine how an expression is evaluated.

Load Balancing expressions also support grouping symbols, which allow you to organize expressions, enforce operator precedence, and nest expressions. For examples and usage, see Grouping symbols in the Firewall Rules documentation.

Comparison operators

Comparison operators return true when a value from an HTTP request matches a value defined in an expression.

This is the general pattern for using comparison operators:

<field> <comparison operator> <value>

Load Balancing expressions support these comparison operators:

NameOperator NotationSupported Data TypesExample (operator in bold)
StringIPRules list
Equaleqhttp.request.uri.path eq "/articles/2008/"
Not equalneip.src ne
containshttp.request.uri.path contains "/articles/"
RE2 regex
matcheshttp.request.uri.path matches "^/articles/200[7-8]/$"
Value is in
a set of values
inip.src in { }

Logical operators

Logical operators combine two or more expressions into a single compound expression. A compound expression has this general syntax:

<expression> <logical operator> <expression>

Each logical operator has an order of precedence. The order of precedence (along with grouping symbols) determines the order in which Cloudflare evaluates logical operators in an expression. The not operator ranks first in order of precedence. For more on how Cloudflare evaluates logical operators in expressions, see Order of precedence in the Firewall Rules documentation.

Load Balancing expressions support these logical operators:

ExampleOrder of Precedence
Logical NOTnot!not ( eq "" and ip.src in )1
Logical ANDand&& eq "" and ip.src in
Logical XOR
(exclusive OR)
xor^^ eq "" xor ip.src in
Logical ORor|| eq "" or ip.src in