Dynamic Route for CDN (DCDN) supports whitelist configurations for cross-origin resource sharing (CORS). This topic describes how to configure CORS for DCDN and the relevant notes.

Procedure

  1. Log on to the DCDN console.
  2. In the left-side navigation pane, click Domain Names.
  3. On the Domain Names page, find the domain name that you want to manage and click Configure.
  4. In the left-side navigation pane of the page that appears, click Caching.
  5. On the Custom HTTP Response Header tab, click Add.
  6. In the Custom HTTP Response Header Settings dialog box that appears, select Access-Control-Allow-Origin from the Response Header drop-down list, specify other parameters by referring to Configure a custom HTTP response header. Custom HTTP Response Header Settings
  7. Click OK. Repeat the steps to add the Access-Control-Allow-Methods header.

Notes

When you configure CORS whitelists, pay attention to the following notes:

  • Wildcard domain names are not supported, such as *.aliyundoc.com. You must specify the exact domain names.
  • Only one domain name can be configured in a whitelist for an account.
  • If the origin server uses an OSS domain name and CORS is configured in the OSS and DCDN consoles, the CORS settings in DCDN overwrite the settings in OSS.