0

I am trying to host Minecraft servers in docker containers on an ec2 instance, and point a different subdomain to each container, for example

a.example.com -> container 1

b.example.com -> container 2

c.example.com -> container 3

...and so on.

If these containers were running a website, I could forward the traffic with Apache, or node-http-proxy, etc. But because these servers are running TCP services, I cannot route the traffic this way.

Is this possible? And if so, how?

JamesS237
  • 25
  • 1
  • 6
  • Does this help you? http://stackoverflow.com/questions/6125472/how-to-route-tcp-ip-responses-through-a-different-interface – TheStoneFox Feb 21 '14 at 20:00

2 Answers2

1

The Minecraft client has supported SRV DNS records for a while now (since 1.3.1 according to google). I suggest you assign your Docker containers a stable set of port mapping with the -p flag, and then create SRV records for each FQDN pointing to the same IP but different ports.

Google gives several hits on the SRV entry format - this one is from the main MCF site: http://www.minecraftforum.net/topic/1922138-using-srv-records-to-hide-ports-on-your-server-ip/

I have four MC servers running on the same physical host with a single IP address, each with a separate friendly entry for players to use in the Minecraft client, so none of my users need to remember a port. It did cause confusion for a couple of my more technical players when they had a connectivity issue, tested with dig/ping, then thought the DNS resolution was broken when there was no A record to be found. Overall, I think that's a very small downside.

0

Doesn't HAProxy http://haproxy.1wt.eu/ route tcp traffic?

TheStoneFox
  • 3,007
  • 3
  • 31
  • 47