dockerwildcard-subdomain

Route traffic to a docker container based on subdomain


I have wildcard dns pointed to my server e.g. *.domain.com

I'd like to route each subdomain to it's own docker container. So that box1.domain.com goes to the appropriate docker container. This should work for any traffic primarily HTTP and SSH.

Or perhaps the port can be part of the subdomain e.g. 80.box1.domain.com. I will have lots of docker containers so the solution should be dynamic not hard-coded for every container.


Solution

  • I went with interlock to route http traffic using the nginx plugin. I settled on using a random port for each SSH connection as I couldn't get it work using the subdomain alone.