Help Center/ Content Delivery Network/ Troubleshooting/ What Should I Do If the Browser Displays a Message Indicating that a Cross-Domain Exception Occurs After CDN Is Enabled?
Updated on 2025-12-26 GMT+08:00

What Should I Do If the Browser Displays a Message Indicating that a Cross-Domain Exception Occurs After CDN Is Enabled?

Symptom

The page is abnormal when a client accesses resources. The following figure shows the error information.

Possible Causes and Countermeasures

The response to the resources in the cross-domain request lacks the header Access-Control-Allow-Origin. In this case, set the response header on CDN. For details, see HTTP Response Headers from PoPs to Clients (CORS).

  • To prevent cross-domain errors caused by browser cache, clear browser cache after setting Access-Control-Allow-Origin.
  • If the origin server of your domain name is an OBS bucket and different CORS rules are configured on CDN and OBS, cross-domain problems may occur. Ensure that the same CORS rules are configured on CDN and OBS. For details about how to configure CORS rules on CDN, see HTTP Response Headers from PoPs to Clients (CORS). For details about how to configure CORS rules on OBS, see Configuring CORS to Allow Cross-Origin Access to OBS.