Multi-Domain Docker Containers
source link: https://carlosvin.github.io/langs/en/posts/reverse-proxy-multidomain-docker/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Use case
We have several server applications in the same development environment, each application is bundled in a Docker container, e.g: "Container A" and "Container B".
With Docker those applications have the same IP address. One way to differentiate and access to an specific application is exposing different ports.
Containers exposing the same IP address and different ports.
-
If we want to call to "Application A" we will do:
GET http://10.20.30.40:8080/colors/red
. -
If we want to call to "Application B" we will do:
GET http://10.20.30.40:8081/fruits/tomato
.
But that solution is a little bit confusing, does 8080 mean we are accessing to "application A"?
It would be simpler and easier to remind something like:
Accessing applications by domain name.
Get that extra semantic value is much simpler than I thought at the beginning and you will see below.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK