Deny
Overview
The Deny policy action allows you to reject incoming requests to your endpoint.
Example
Traffic Policy for returning a 404 response.
- YAML
- JSON
# snippet
---
actions:
- type: "deny"
config:
status_code: 404
// snippet
{
"actions": [
{
"type": "deny",
"config": {
"status_code": 404
}
}
]
}
Request:
curl https://example.ngrok.app/api/v1
Result:
< HTTP/2 404
Behavior
When this action is executed, the upstream server is never reached and a response is immediately made.
If this action is executed, no further actions or policy rules in the policy configuration will be executed.
Reference
Supported Directions
- Inbound
Configuration
Type |
---|
deny |
Parameter | Description | |
---|---|---|
status_code | int | The status code of the response. If not specified, 999 will be used. |