Search code examples
asp.net-coreidentityserver4

Identity Server Redirect URL for an Application behind reverse proxy


Question is the following: we have an ASP.NET Core application which sits behind nginx, with public url https://public and private url https://private. When the user hits an application, there is a login redirect to Identity Server, which contains private url as redirect url. Can anyone suggest how to rewrite this url to be a public one?

Regards


Solution

  • Actually some days ago I had the same issue with identityserver. I ordert to work quite different depending on the version of identityserver. Until 4.0 version you can set

    Public origin = your public url

    From 4.0 you have to setup your proxy in order to pass X forwarded headers.

    In order to work you need to use dotnet Middleware described in the docs https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-3.1