Traffic Policy
ngrok's Traffic Policy is a configuration language that offers you the flexibility to filter, match, manage and orchestrate traffic to your endpoints.
With ngrok's Traffic Policy you can:
- Validate incoming traffic
- Block malicious traffic
- Rewrite URLs
- Respond with custom content
- Forward traffic to your agents running across the globe
- And more
Because you can add traffic policies to any type of ngrok endpoint, you can use them to scope traffic management for each of your endpoints. For example, API teams can manage a traffic policy for their internal services while devops or security teams can manage policies for public services.
Get Started
Learn how traffic policies work, key concepts, examples, and identity management principles.
Quickstart
Apply a traffic policy to your app with the ngrok agent in 5 minutes.
Get started with Traffic Policy →Learn the Concepts
Deep dive into the parts that make up a traffic policy and how it works.
Examples / Use-Cases
Dive into practical examples, use-cases, and guides to see traffic policies in action.
Traffic Policy Building Blocks
Actions
Utilize actions, such as add-headers
and rate-limit
, to transform,
redirect, and manage traffic flow with advanced control options.
Variables
Use variables to filter, segment, and dynamically configure traffic rules and actions based on specific conditions.
Macros
Apply macros in rule conditions to refine traffic segmentation and configure actions with dynamic precision.