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
- Log on to the DCDN console.
- In the left-side navigation pane, click Domain Names.
- On the Domain Names page, find the domain name that you want to manage and click Configure.
- In the left-side navigation pane of the page that appears, click Caching.
- On the Custom HTTP Response Header tab, click Add.
- 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. - 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.