Couper Documentation

edge

Server

The server block is one of the root configuration blocks of Couper's configuration file.

Block nameContextLabel
server-optional

Attribute hosts

The hosts attribute allows to start multiple Couper instances with a single configuration file. You can add a specific port to your host.

Example: hosts = ["8080", "9090"] or hosts = ["example.com:9090", "*:8080"]

Attributes

NameTypeDefaultDescription
access_control
tuple (string)
[]

The access controls to protect the server. Inherited by nested blocks.

add_response_headers
object
-

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

base_path
string
-

The path prefix for all requests.

custom_log_fields
object
-

Log fields for custom logging. Inherited by nested blocks.

disable_access_control
tuple (string)
[]

Disables access controls by name.

error_file
string
-

Location of the error file template.

hosts
tuple (string)
[]

Mandatory, if there is more than one server block.

remove_response_headers
tuple (string)
[]

List of names to remove headers from the client response.

set_response_headers
object
-

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

Nested Blocks

NameDescription
api

Configures an API (zero or more).

cors

Configures CORS settings (zero or one).

endpoint

Configures a free endpoint (zero or more).

files

Configures file serving (zero or more).

spa

Configures an SPA (zero or more).

tls

Configures server TLS (zero or one).