[proxy] ngrok.com← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

Traffic Policy Overview - ngrok documentation

ngrok’s Traffic Policy is a configuration language that offers you the flexibility to filter, match, manage, and orchestrate traffic to your endpoints.

Concepts

Phases

Defined points in the lifecycle of a request to your endpoint where you can use Traffic Policy to modify request headers, transform response bodies, and more.

Phase Rules

Conditions and actions you configure to filter, manipulate, or manage traffic at specific phases, such as blocking requests from certain IPs or adding authentication headers.

Expressions

Conditions used in Phase Rules to determine when an action should be applied, such as checking if a request header matches a value or if an IP address is in a blocklist.

Actions

Operations that execute when a Phase Rule condition is met, such as adding headers, rate limiting requests, or redirecting traffic.

CEL Interpolation

Dynamically evaluate variables and macros in configuration values, such as inserting request headers into URLs or using timestamps in response headers.

Features

Use cases

What’s next?