Azure container apps & application gateway - Stack Overflow

admin2025-04-26  3

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 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

We've tried this 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

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

Share Improve this question asked Jan 13 at 16:31 AdrianAdrian 235 bronze badges 1
  • I Just posted a new blog post about Configuring ASP.NET Core Forwarded Headers Middleware that might help you troubleshoot this. I also posted an article about getting OpenIDConnect to work behind a proxy at IdentityServer in Docker Containers. – Tore Nestenius Commented Apr 11 at 6:10
Add a comment  | 

1 Answer 1

Reset to default 0

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

转载请注明原文地址:http://anycun.com/QandA/1745637140a91041.html