Skip to content

Support hard-coded HTTP responses #2315

@brian-pane

Description

@brian-pane

Description:

There are use cases where it is desirable for an HTTP proxy to return a configured HTTP response without proxying to an upstream server.

Some examples:

  • If path == /some_health_check_endpoint, return a 200.
  • If path == /some_invalid_url_that_clients_are_requesting_nonstop, return a 404 directly to shield the upstream from overload.

Proposed configuration model:

  • Add a new action type, DirectResponseAction, that can be used in place of RouteAction and RedirectAction.
  • Let the DirectResponseAction config specify the HTTP response status, an optional reason string, an optional content-type, and an optional response body.

Metadata

Metadata

Assignees

Labels

enhancementFeature requests. Not bugs or questions.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions