INTEGRITY Cloudflare Docs

Cross-Origin Resource Sharing (CORS)

A cross-origin request occurs when a webpage on one origin (for example, a.example.com) requests a resource from a different origin (for example, b.secondexample.com). Cross-Origin Resource Sharing (CORS) is a mechanism that uses HTTP headers to let the server at b.secondexample.com indicate whether a.example.com is allowed to access its resources. Browsers enforce these headers and block access to responses that are not permitted.

Cloudflare supports CORS by:

The Access-Control-Allow-Origin header lets a server specify rules for sharing its resources with external origins. A server may respond with different Access-Control-Allow-Origin values depending on the Origin header in the request. These headers are often present on cacheable content.

Add or change CORS headers at the origin server

If you add or change CORS configuration at your origin web server, purging the Cloudflare cache by URL does not update the CORS headers. Force Cloudflare to retrieve the new CORS headers via one of the following options:

Add or change CORS headers on Cloudflare

You can use one of following methods to set CORS headers using Cloudflare products: