Direct Response
Summary
Direct Response instructs Pomerium to send a static HTTP response to the downstream client for a managed route.
How to configure
- Core
- Enterprise
- Kubernetes
Config file keys | Type | Usage |
---|---|---|
response | object | optional |
response.status | integer | optional |
response.body | string | optional |
Example
The response
configuration key must replace the to:
destination URL in a route block:
routes:
- from: https://example.com
response:
status: 200
body: 'plain text'
Additional HTTP response headers, such as Content-Type, can be defined with the set_response_headers
setting:
routes:
- from: https://example.com
response:
status: 200
body: "plain text"
set_response_headers:
Content-Type: "text/plain; charset=us-ascii"
Configure Direct Response in the Enterprise Console:
Additional HTTP response headers, such as Content-Type, can be defined with the set_response_headers
setting.
Currently, the Direct Response setting is not supported for the Ingress Controller. If you'd like support for this feature, see the GitHub issue and describe your use case.