CORS error when trying to access Azure API from client app

I’m new to Cloudflare.

I’m using Cloudflare with Azure. I’ve got a web client running as portal.mydomain. I’ve got an API running as api.mydomain. I’ve added portal.mydomain to my CORS policy on the API.

The application works just fine if I login from the myappname.azurewebsites domain. I can call both myapi.azurewebsites or api.mydomain.

Seeing as I just implemented Cloudflare and I’m calling the api from portal.mydomain, I’m thinking this is a problem with Cloudflare.

Do I need to add something to my CORS policy on the API to get this to work? Do I need to do something on the Cloudflare side to get this to work?

After I encountered another issue, I’m running SSL/TLS in Full (strict) mode.

Thanks!

For now, I’m just using Cloudflare for SSL.

I finally got it to work. I had placed a “/” at the end of the domain. This is on my API server.

builder.WithOrigins(“http://portal.mydomainname.com/”, “https://portal.mydomainname.com/”)

It should look like this.

builder.WithOrigins(“http://portal.mydomainname.com”, “https://portal.mydomainname.com”)