CORS issue with Azure Application Proxy

Erik Andersson 26 Reputation points
2026-03-12T15:30:19.1733333+00:00

I currently have two on-premise apps, one is the web app and the other is the API for it. Lets call them app.customdomain.com and api.customdomain.com. These work on the internal network but I want to publish them externally through the Application Proxy we have set up.

Config:

I've added these apps to the proxy using a wildcard app with the URL"https://*.customdomain.com" with 2 application segments added with URLs "https://app.customdomain.com" and "https://api.customdomain.com" and added the following CNAMe records to our external DNS:

app.customdomain.com -> `

Microsoft Security | Microsoft Entra | Microsoft Entra ID

Answer accepted by question author
Sridevi Machavarapu 33,820 Reputation points Microsoft External Staff Moderator
2026-03-12T16:58:29.0966667+00:00

Hello Erik Andersson,

Thanks for the update.

From what you’ve tested, the API is returning the correct CORS headers and the preflight request is working. The issue comes from the GET request returning a 302 to login.microsoftonline.com.

That response doesn’t include CORS headers, so the browser blocks it. The request is being intercepted for authentication and never reaches your API.

Your wildcard + segments setup is correct. It handles routing, not authentication, so nothing is misconfigured there.

Since it works after disabling pre-auth, that confirms the cause.

You can either keep pre-auth off for the API and handle authentication in the app, or keep pre-auth enabled and send the request with a valid token so no redirect happens.

So this is expected behavior for this setup, not a configuration issue.

Reference: https://learn.microsoft.com/entra/identity/app-proxy/application-proxy-understand-cors-issues

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.