0

I have a couple containers running on my host (Ubuntu Server), and I can access them on my network via host:port. I'm trying to use containers to replace IIS, so I'm trying to figure out how to assign hostnames to which the containers would respond, but I'm coming up short. Is there a way to have each container respond to the same ports (e.g., container1.example.com, container2.example.com), or does this necessitate some sort of appliance or reverse proxy sitting in front to forward from name.example.com to host:port?

1

It looks like you do want to put a reverse proxy in front, but you can do that with a container as well:

https://www.thepolyglotdeveloper.com/2017/03/nginx-reverse-proxy-containerized-docker-applications/

https://github.com/jwilder/nginx-proxy

http://jasonwilder.com/blog/2014/03/25/automated-nginx-reverse-proxy-for-docker/

This also means you don't need to map the ports of the other containers to the host, just the one for the reverse proxy.

1
  • 1
    For plain docker, jwilder/nginx-proxy is what most people seem to use. – Michael Hampton Aug 3 '18 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.