I am using image
microsoft/aspnet:4.7.1 and setting up a site in IIS.
The problem I have is I need to redirect to an authentication site, then redirect back to the application. This cannot be configured statically and the base url of where to redirect to (after authentication) is derived from the host. In C# this is retrieved from the
HttpContext.Current.Request object. Inside the container, however, all requests are viewed as originating from
http://localhost but I am accessing the container via a different hostname (something like
http://myapp. After authentication, the we are redirected back to
http://localhost instead of
http://myapp. Is there some way in docker or in IIS that I can “passthrough” the host that is used to access the container in the first place?
Thanks for the help!