Skip to main content

Add custom HTTP headers to user response

You can add HTTP headers to the response to a user request. For example, to manage caching or pass service information.

HTTP headers can be hidden from the user.

If you have CDN-side CORS checking enabled, custom headers will be added to the response after the check. If a custom header and a CORS header match, the value of the custom header will be displayed in the response to the user. For example, for the header Access-Control-Allow-Origin in CORS, the value is set to https://example.com, and the custom header value is *. After the CORS check, the header Access-Control-Allow-Origin:* will be passed in the response to the browser.

  1. In the control panel, in the top menu, click Products and select CDN.

  2. In the CDN resources section, open the resource page → Headers tab.

  3. In the Client headers block, click Add header.

  4. Enter the header name. You can use Latin letters, numbers, underscores, and hyphens.

  5. Enter the header value. You can use Latin letters, digits, underscores, periods, forward slashes, colons, hyphens, equal signs, and spaces. Spaces can only be added within the value and between words. Do not add a space at the beginning or end of the value.

  6. If you need to add another header, click Add header and repeat steps 4–5.

  7. If the added headers need to be hidden from the user, select them from the list.

  8. Click Apply. While the settings are being applied, the resource will be in the PROCESSING status. During this time, applying other settings is unavailable. The settings will apply once the resource status changes to ACTIVE.

  9. Purge the resource cache.