Couper Documentation

edge

Proxy

The proxy block creates and executes a proxy request to a backend service.

📝 Multiple proxy and request blocks are executed in parallel.

Block nameContextLabel
proxyEndpoint BlockSee Label description below.

Label: If defined in an Endpoint Block, a proxy block or Request Block w/o a label has an implicit name "default". If defined in the Definitions Block, the label of proxy is used as reference in Endpoint Blocks and the name can be defined via name attribute. Only one proxy block or Request Block w/ label "default" per Endpoint Block is allowed.

Attributes

NameTypeDefaultDescription
add_form_params
object
-

Key/value pairs to add form parameters to the upstream request body.

add_query_params
object
-

Key/value pairs to add query parameters to the upstream request URL.

add_request_headers
object
-

Key/value pairs to add as request headers in the upstream request.

add_response_headers
object
-

Key/value pairs to add as response headers in the client response.

backend
string
-

References a backend in definitions for the proxy request. Mutually exclusive with backend block.

expected_status
tuple (int)
[]

If defined, the response status code will be verified against this list of codes. If the status code not included in this list an unexpected_status error will be thrown which can be handled with an error_handler.

name
string
"default"

Defines the proxy request name. Allowed only in the definitions block.

remove_form_params
object
-

List of names to remove form parameters from the upstream request body.

remove_query_params
tuple (string)
[]

List of names to remove query parameters from the upstream request URL.

remove_request_headers
tuple (string)
[]

List of names to remove headers from the upstream request.

remove_response_headers
tuple (string)
[]

List of names to remove headers from the client response.

set_form_params
object
-

Key/value pairs to set query parameters in the upstream request URL.

set_query_params
object
-

Key/value pairs to set query parameters in the upstream request URL.

set_request_headers
object
-

Key/value pairs to set as request headers in the upstream request.

set_response_headers
object
-

Key/value pairs to set as response headers in the client response.

url
string
-

URL of the resource to request. May be relative to an origin specified in a referenced or nested backend block.

websockets
bool
false

Allows support for WebSockets. This attribute is only allowed in the "default" proxy block. Other proxy blocks, request blocks or response blocks are not allowed within the current endpoint block. Mutually exclusive with websockets block.

If the url attribute is specified and its value is an absolute URL, the protocol and host parts must be the same as in the value of the {origin} attribute of the used backend.

Nested Blocks

NameDescription
backend

Configures a backend for the proxy request (zero or one). Mutually exclusive with backend attribute.

websockets

Configures support for websockets connections (zero or one). Mutually exclusive with websockets attribute.