edit-icon download-icon

How to set CORS access using a website accelerated by Alibaba Cloud CDN

Last Updated: Dec 01, 2017

After Alibaba Cloud CDN acceleration is enabled for a website, if a non-cross-origin access first occurs on an Alibaba Cloud CDN node, the file content without the CORS header will be cached in the Alibaba Cloud CDN. An access error is prompted for all cross-origin accesses before expiration because the CORS header information is absent. Such a problem can be avoided by setting the CORS header information using the user-defined headers of Alibaba Cloud CDN.

  1. Log on to the Alibaba Cloud CDN console, and find Set HTTP Header:

88

  1. Set the header Access-Control-Allow-Origin, Access-Control-Allow-Methods and Access-Control-Max-Age based on your requirements:

888

  1. View the configured CORS header information.

    c2.png

Note: The CORS header information set on the Alibaba Cloud CDN console is valid for the Alibaba Cloud CDN domain name, and the header information set on the origin site will be overwritten.

If the problem persists, contact Alibaba Cloud After-Sales Technical Support.

Thank you! We've received your feedback.