The Close Connection Traffic Policy action lets you forcibly close connections to an endpoint when certain conditions are met, for example, when the number of requests exceeds a given limit (to mitigate DDoS attacks). This action can be used with other actions such as rate-limit and deny.Documentation Index
Fetch the complete documentation index at: https://ngrok.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Configuration reference
The Traffic Policy configuration reference for this action.Supported phases
on_http_request, on_tcp_connect
Type
close-connection
Configuration fields
This action does not have any configuration fields.
Behavior
When this action is executed, connection to the endpoint is closed immediately. This can be useful for dealing with DDoS attacks.Terminating action
This is a terminating action. It will return a response and cause Traffic Policy processing to end without executing any further Actions.Examples
Basic example
This basic example configuration will guide you through setting up an endpoint on ngrok (hotdog.ngrok.app) and closing the connection to the endpoint.
Action result variables
The following variables are made available for use in subsequent expressions and CEL interpolations after the action has run. Variable values will only apply to the last action execution, results are not concatenated.This action does not set any variables after it has been executed.