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. Click the HTTP Header tab.
  6. On the HTTP Header tab, click Add.
  7. In the HTTP Header Setting dialog box that appears, select Access-Control-Allow-Origin from the Parameter drop-down list, specify the Value field based on the actual environment, and then click OK. Repeat the same steps to add the Access-Control-Allow-Methods header.Customize an HTTP header

Notes

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

  • Wildcard domain names are not supported, such as *.12345.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.