I am currently using IdentityServer 4 for a project where an App communicates with a Web API that is on an internal server behind a reverse proxy. The problem i am facing has to do with the URLs returned in the discovery document.
- The App calls an external URL that is then being redirected to an internal URL.
- IdentityServer on the Web API returns a discovery document that contains endpoints using the external URL.
- The Web API tries to call an endpoint with an external URL, but that host cannot be found on the internal server.
- If i change the endpoints to use the internal URL using the guide found here, the App will later use these endpoints with the internal URL. But of course the internal server cannot be accessed from the outside.
Is there a way to tell IdentityServer to use the external URL when in the App and use the internal URL when in the Web API?