Couper Documentation

edge

Merging

Couper supports merging of blocks and attributes from multiple configuration files (see Basic Options of Command Line Interface).

General Rules of Merging

When merging, all attributes (except environment_variables in the defaults block) replace existing attributes with the same name, if any, otherwise they are added.

Blocks that cannot have labels (eg. cors, files etc.) replace existing blocks with the same name, if any, otherwise they are added.

Blocks with optional labels (eg. server, api, spa, files etc.) are merged recursively with blocks with the same label (blocks without a label are merged with blocks with the same name and no label in each context), if any, otherwise they are added. Only one unlabeled block of the same type is allowed in each context (eg. api blocks in a server block).

Blocks with required label (eg. endpoint) replace existing blocks with the same name and label in each context, if any, otherwise they are added.

Blocks with (optional) multiple labels (eg. error_handler) replace existing blocks with identical labels, if any, otherwise they are added.

Currently, here is no way to remove an attribute or a block from the configuration.

Merging of server Blocks

Note: An error_handler block cannot be replaced in or added to an endpoint block. Therefore, the endpoint block must be completely replaced.

Merging of definitions Blocks

Merging of defaults Blocks

Merging of settings Blocks