Edge Rules Variable Expansion

Edge Rules allow you to use variable expansion to dynamically configure the value of the result based on specific request parameters.

Variable expansion is supported by the following rules:

  • Change Origin URL
  • Redirect to URL
  • Set Request Header
  • Set Response Header

Variable expansion is performed through the following syntax %{Collection.Key} where the collection is a super-set of variables that can be accessed with the specific key. Some collections such as request headers or query parameters are automatically populated based on the request data whereas others have a specific set of keys.

Supported variable collections:

RequestHeaders

The RequestHeaders collection is automatically populated with keys from the HTTP request. Request headers sent with the request are automatically mapped based on their key. For example %{RequestHeaders.Host} will contain the Host header sent with the request.

Query

The Query collection is automatically populated with keys from the HTTP request. Query parameters sent with the request are automatically mapped based on their key. For example %{Query.Value} will be mapped with the URL parameter ?Value=hello.

Request

The Request collection contains a set of variables from the list below:

  • Method: The HTTP method that was sent with the request (such as GET, POST, etc.)
  • Path: The full URL path and query of the HTTP request
  • QueryString: The full URL query string parameter of the HTTP request

Url

The Url collection contains a set of variables from the list below:

  • FileName: The file name of the requested URL. If the request is to a folder, this will remain empty.
  • Path: The full URL path and query of the HTTP request
  • Extension: The extension of the requested filename
  • Directory: The directory of the requested URL without the file name
  • Hostname: The hostname that was sent with the HTTP request

User

The User collection contains a set of variables from the list below:

  • IP: The IP of the end-user that initiated the request
  • CountryCode: The two-letter country code of the end-user that initiated the request

Server

The Server collection contains a set of variables from the list below:

  • ZoneCode: The Zone Code of the server that is serving the request
  • ID: The unique ID of the server that is serving the request