Minecraft VirtualHost

Discussion in 'Spigot Plugin Development' started by VentureForo, Jun 29, 2016.

  1. Hi, I am wondering if you can get virtual host for minecraft. kinda like how you can set it up in apache, that if it matches example.com it'll go to example.com:25567 or any other port. Thanks contact me back if you have a solution. :)
    Code (Text):
    Listen 80
    <VirtualHost *:80>
        DocumentRoot "/www/example1"
        ServerName www.example.com

        # Other directives here
    </VirtualHost>

    <VirtualHost *:80>
        DocumentRoot "/www/example2"
        ServerName www.example.com

        # Other directives here
    </VirtualHost>
     
    • Informative Informative x 1
  2. What you're thinking of is a proxy. You can do this with BungeeCord.
     
  3. How would I do this? Multiple server on 1 ip?
     
    • Creative Creative x 1
  4. So how would I do this?
    Code (Text):
      forced_hosts:
        c.linkedmc.com: creative
        s.linkedmc.com: survival
    If Im hosting 2 minecraft servers and I want it to be 1 ip off both of them? Could someone help?
     
    • Friendly Friendly x 1
  5. Set your DNS entry (A record) to point both subdomains s and c to the same IP (the IP of your proxy)
     
  6. But is there a way to do this so if an ip matches something in config, itll change it and itll be able to display that server's motd in the muliplayer list instead of having to connect to a server first then connecting to that?
     
    • Winner Winner x 1
  7. Not sure what you mean with that, to be honest
    BungeeCord should be able to handle both of those (the latter is 'forced host', not sure about the first one, but it probably contains 'motd')
     
  8. Could you help with this? I will pay, budget is 1-5 depending on work
     
    • Like Like x 1
  9. Okay, I'll break this down:

    If you want s.YOURSITE.com and c.YOURSITE.com to go to specific servers, have both of them point to the proxy's IP address. Then, in the BungeeCord config, put:
    Code (Text):
        c.linkedmc.com: creative
        s.linkedmc.com: survival
    under "forced hosts". This will let people using "s.linkedmc.com" to connect to survival, and c to creative.

    For the MOTD of each server, set "ping-passthrough" or similar in the Bungeecord Config to "True". By default it is false. This will then show the MOTD and player count of the servers you setup in forced host. (Ex: If I have s.linkedmc.com in my server list, it will show that server's MOTD and player count, not the proxy's).
     
  10. I would recommend looking up how to do an SRV record. That might help :)
     
  11. That wouldn't force them through the proxy though, that'd just redirect right to the server, and they'd be disconnected.
     
  12. OP said nothing about using BungeeCord, therefore I was assuming that he wanted it so like his survival server could be on like 25566 and join with like survival.domainname.com and then have like prison on 25567 and then join with prison.domainname.com and not need to have the port, but neither would be connected to a BungeeCord. Also what do you mean by that they would be disconnected?
     
  13. @DEC0DE Above is what I was referring to. They'd be disconnected because they'd try to join a bungee-cord connected server directly, giving them an error about IP-Forwarding.
     
  14. Yes correct
     
    • Like Like x 1
  15. I'd just enabled it, problem fixed..
     
    • Like Like x 1