Skip to main content

Add custom HTTP headers to user response

Last update:

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-specified header match, the value of the custom header will be displayed in the response to the user. For example, for the Access-Control-Allow-Origin header, the CORS value is set to https://example.com, and the custom header value is *. After the CORS check, the Access-Control-Allow-Origin:*..

  1. In the control panel, on 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, numbers, underscores, dots, slashes, colons, hyphens, equals signs, and spaces. Spaces can only be added within the value and between words. Do not put 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 settings are being applied, the resource will have the PROCESSING status. You cannot apply other settings at this time. Settings will be applied when the resource transitions to ACTIVE.

  9. Clear the resource cache.