I would like to use rancher/docker with multiple containers with multiple hostname in single ip and single server.
I only have one server and one ip.
I would like
abc.hostname.com -> container 1
wp.hostname.com -> wordpress container with a mysql
ror.hostname.com -> ruby on rails container with a postgresql
I really cannot find any tutorial about this. Most docker is use on single ip. Then I tried rancher myself. I can only make first one working. Cannot work with second and third. I used LB too.
We are using an nginx-proxy container and a letsencrypt companion container to handle this.
With nginx-proxy, you can add environment variables to set the URLs the containers should be available on, e.g.
If you add
Then the companion container will go an create SSL certs for you as well.
This works very well - and is a standard setup on any docker host that we create.
Moving forward, we need to work out how to move this up a level though with HA, LB and a single place for all of the SSL certs we are creating.
Here are the docs on how to set up multiple host name routing rules.
Here’s also a blog post when we first came out with the feature.
I don’t quite think that will do it.
We have been playing with traefik for a while - and it is almost what we are looking for. But we have run into some limitations that may be show stopping.
What I would really like to see, is for the built-in load balancer in Rancher to be able to dynamically update itself using metadata from rancher when services are started and stopped - exactly like traefik does - but as a native Rancher solution. This should obviously also support multiple SSL certs - and even better with dynamic Letsencrypt support.
I understand new load balancer stuff is coming out with Rancher 1.2. Anyone know what we can expect here?