Skip to main content
Traffic Policy uses CEL expressions and interpolation to dynamically route requests to different internal endpoints. Route based on virtually any request attribute—subdomain, path, headers, cookies, query parameters, geographic location, IP intelligence, and more.
All routing examples use the forward-internal action to send traffic to internal endpoints. See the action reference for configuration details.

Routing methods


By subdomain

Route requests from https://*.example.com to corresponding internal services.

Extract subdomain dynamically

Route specific subdomains

By path

Route requests to different services based on URL path patterns.

API versioning

Microservice routing

By header

Route requests based on custom header values. Use this for customer-specific routing, feature flags, or A/B testing.

Customer-specific routing

Feature flag routing

Route based on cookie values for session-based routing or sticky sessions.

A/B testing with cookies

By query parameter

Route based on query string parameters. Use this for debug modes or testing environments.

Debug routing

Environment routing

By geographic location

Route requests based on the geographic location of the client IP. Use this for compliance requirements or serving region-specific content. See connection variables for available geo fields.

Route by country

Route by continent

By IP Intelligence variables

Use IP Intelligence to route traffic based on IP categories, reputation, or autonomous system information. This is useful for threat detection, bot management, and compliance.

Route by autonomous system

Route traffic based on the network it originates from. Use this for treating cloud provider traffic differently.

Route anonymous proxy traffic

By device type

Route mobile users to a mobile-optimized service using user agent variables.

By client certificate

When Mutual TLS (mTLS) is enabled, route requests based on client certificate details like the common name.

Combine multiple conditions

Create complex routing logic by combining multiple conditions.

Route by path and method

Route by content type