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.
namestringA handle to refer to this Header object.
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.
ignore_if_setintegerDon't add the header if it is added already. Only applies to 'set' action.
priorityintegerPriority determines execution order. Lower numbers execute first. [Default 100]
created_atstringDate and time in ISO 8601 format. Read-only.
deleted_atstringDate and time in ISO 8601 format. Read-only.
service_idstringAlphanumeric string identifying the service. Read-only.
updated_atstringDate and time in ISO 8601 format. Read-only.
versionstringString identifying a service version. Read-only.

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