Header

Header objects are used to add, modify, or delete headers from requests and responses. The header content can be simple strings or be derived from variables inside Varnish. Regular expressions can be used to customize the headers even further.

Data model

actionstringAccepts a string value.
cache_conditionstringName of the cache condition controlling when this configuration applies.
dststringHeader to set.
ignore_if_setintegerDon't add the header if it is added already. Only applies to 'set' action.
namestringA handle to refer to this Header object.
priorityintegerPriority determines execution order. Lower numbers execute first.
regexstringRegular expression to use. Only applies to regex and regex_repeat actions.
request_conditionstringCondition which, if met, will select this configuration during a request. Optional.
response_conditionstringOptional name of a response condition to apply.
srcstringVariable to be used as a source for the header content. Does not apply to delete action.
substitutionstringValue to substitute in place of regular expression. Only applies to regex and regex_repeat actions.
typestringAccepts a string value.
created_atstringDate and time in ISO 8601 format.
deleted_atstringDate and time in ISO 8601 format.
service_idstringAlphanumeric string identifying the service.
updated_atstringDate and time in ISO 8601 format.
versionintegerInteger identifying a service version.

Endpoints

List Header objects

GET/service/service_id/version/version_id/header

Create a Header object

POST/service/service_id/version/version_id/header

Get a Header object

GET/service/service_id/version/version_id/header/header_name

Update a Header object

PUT/service/service_id/version/version_id/header/header_name

Delete a Header object

DELETE/service/service_id/version/version_id/header/header_name