CORS Essentials
上QQ阅读APP看书,第一时间看更新

Enabling CORS globally with server configuration

Depending on your web server, you may be able to add the Access-Control-Allow-Origin header to allow CORS globally on every page in the server configuration.

Enabling CORS globally is not recommended since it removes granular control per page or application.

Tip

Enabling CORS globally may be useful when you are only running a single application on the server, and every page needs to support CORS. By adding the header in the server configuration, you do not need to add the Access-Control-Allow-Origin header on a per-page basis.