deny

Rejects the request with a status code, or drops the connection when it runs in on_tcp_connect.

Phaseson_tcp_connecton_http_request
Terminating Yes — once it answers, nothing after it runs.
Cost Free

Example

policy.yaml
on_http_request:
  - name: BlockAdmin
    expressions:
      - "req.url.path.startsWith('/admin')"
    actions:
      - type: deny
        config:
          status_code: 404

Start an agent endpoint with it: devgate http 8080 --traffic-policy-file policy.yaml, or paste it into a reserved or cloud endpoint’s Traffic Policy tab in the dashboard.

Configuration

Field Type Description
status_code integer HTTP status to answer with, 100 to 599. Default: 403.

Behaviour

  • Pair it with expressions: a deny without any blocks every request.

Other actions

add-headers remove-headers compress-response basic-auth oauth openid-connect jwt-validation custom-response redirect url-rewrite restrict-ips rate-limit circuit-breaker verify-webhook http-request set-vars log close-connection forward-internal