http-redirectdnsporthostnamedocker

port redirect to docker containers by hostname


I want to setup serve multiple sites from one server:

1. http://www.example.org => node.js-www (running on port (50000)
2. http://files.example.org => node.js-files (running on port 50001)

Until now I only found out to have docker doing port redirect when using static ips.

Is is actual possible to use docker for port redirection via hostname?

I use a free amazon EC2 insance.

Thanks Bo

EDIT: I want to have multiple nodes applications running on the same port but however serving a different hostname.


Solution

  • As far as I'm aware docker does not have such functionality built in, nor it should. To accomplish what you're trying to do you'd probably need some sort of reverse proxy, so node.js or nginx would do. Bouncy might be a good option: https://www.npmjs.com/package/bouncy