Services on same IP but different ports

I migrated from cPanel to Virtualmin and I’m very happy that I did. Also, I took the harder route by reproducing everything from scratch which allowed me to clean up so much.

Anyway, somehow in cPanel I was able to have minecraft server and website use the same URL. I can’t seem to get this working again. What kind of DNS setup should I have to accomplish this? Here’s the details on what I want as an example…

  • URL: minecraft.domain.com
  • IP: 1.1.1.1 (different than shared IP all other sites use of i.e. 2.2.2.2)
  • Only one DNS A entry for example URL to point to IP
  • Note: Should work for both website and game server

When I created the virtual server as a subserver of domain.com, it used the shared IP and showed the website properly. When I changed that IP to what the game server IP used to be, it worked for the game server URL but website now says “It works!” instead of the content I had on there. What did I do wrong?

If I need to provide more information please let me know what to provide. Do the subserver need their own entries for name servers?

Howdy,

You probably need some sort of proxying setup… you can look into that by going into Server Configuration -> Proxy Paths.

Or if there’s one domain in particular that should always proxy to a given URL, you could use Server Configuration -> Edit Proxy Website.

-Eric