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

What Do 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 Header Settings (Cross-origin Requests).

  • To prevent cross-domain errors caused by browser cache, clear browser cache after setting Access-Control-Allow-Origin.
  • If your domain name is an OBS bucket and CORS rules are configured on CDN, you also need to configure CORS on OBS.