We have a Blazor container app on Azure behind an Application Gateway that has a public IP.
The application is accessible through the gateway but when a url is called, Auth0 authentication for example, the domain of the container app is used rather than the IP of the gateway.
We've looked at forwarding the host headers (UseForwardedHeaders) in the application but this didn't seem to make a difference.
Example: http://123.123.123.123 is the public address of the Application Gateway and https://thisismysite.azurecontainerapps.io is the internal container application url.
If you go to http://123.123.123.123 it displays the application ok but clicking login builds a redirecturl of https://thisismysite.azurecontainerapps.io/callback
We've tried this https://learn.microsoft.com/en-us/answers/questions/1808855/azure-app-container-and-app-gateway-host-name-is-n but it results in 502 error.
Is there something obvious we're missing? Let me know if more info is needed in the question.
Many thanks, Adrian
I think this is more a configuration related to Auth0's call back url. Worth checking your code in your app and see how the Auth0's return url is generated. My guess is that the app is creating the callback url based on container app's host name rather than the actual frontend url/domain.
this post on auth0 forum seems to have similar issue https://community.auth0.com/t/web-server-behind-gateway-authorization-flow/46060