Blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present

My web app held in Cloudflare server keeps having the error whenever I utilise a particular API.
Access to XMLHttpRequest at :// from origin ‘://’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
The startup.cs is set up with the following:
services.AddCors(options =>
options.AddDefaultPolicy(builder =>
Appsetting setup:
“Application”: {
“AppDomain”: “://”,
“AccessBeAppDomain”: “://”,
This error only appears in Cloudflare environment, when in Production or localhost environment, it works fine. I look forward to your reply.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.