Traffic Policy
ngrok's Traffic Policy is a powerful configuration language for ngrok endpoints and edges, offering the flexibility to filter, match, manage and orchestrate traffic exactly as you need.
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.
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.