Need help with some networking

I have the following scenario:

I use a HAProxy infront of my Web Application and my IdentityServer. I use the HAProxy for SSL Termination and as a reverse proxy. I got this running in a production scenario and it works great. In my Web Application I have the public address of my IdentityServer. I am trying to set up a development environment the same way and I am running in some networking issues.
I thought I could just edit the hosts file on my dev machine which is running my docker host to resolve the address of the IdentityServer to point back at the docker host and then the HAProxy proxies the call to the correct. Not sure why but this is not working.

Anyone done something similar?

You should be able to make that work with docker-compose and a docker-compose.yml file. Simply create a docker-compose.yml with an entry for each. Docker has built-in DNS so that one service can access other ones using as hostname the service name you choose in the docker-compose.yml file.

thanks for getting back to me.

because the identity server checks the incoming url I was not able to just do a container to container communication, as you suggested.

but for docker on windows i added the IP to the extra_hosts and then had to open the port 443 on my windows firewall to get this working. the guys working on eShopOnContainers did the same thing and i was able to “copy” the approach.