Related Documentation
Made by
Kong Inc.
Supported Gateway Topologies
hybrid db-less traditional
Supported Konnect Deployments
hybrid cloud-gateways serverless
Compatible Protocols
grpc grpcs http https

This plugin terminates incoming requests with a specified status code and message. This can be used to temporarily stop traffic on a Gateway Service or a Route, or even block a Consumer.

This plugin can also be used for debugging, as described in the config.echo parameter.

Once this plugin is enabled, every request within the configured scope will be immediately terminated with the configured status code and message.

Request termination priority

This plugin has a priority of 2, which is the lowest priority of all plugins except Post-Function. This means it will execute after all other plugins have been applied.

The Request Termination plugin will not execute if the Forward Proxy plugin is enabled. This is because the Forward Proxy plugin has a higher priority, and when it executes, the request is forwarded according to that plugin’s configuration.

To change the execution order, configure dynamic plugin ordering.

Example use cases

The following table lists some common use cases for the Request Termination plugin:

If you want to…

Then see…

Temporarily disable a Service

For example, if the Service is under maintenance
Block requests on Service
Temporarily disable a Route

For example, if the rest of the Service is up and running, but a particular endpoint must be disabled
Block requests on Route
Temporarily disable a Consumer

For example, if you have a Consumer with excessive consumption
Block requests by Consumer
Block anonymous access with multiple authentication plugins in a logical OR setup Allow clients to choose their authentication methods and prevent unauthorized access
Debug erroneous requests in live systems using config.echo Debug requests by echoing response back to client
Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!