One IP, two servers, two (sub)domains. Reverse proxy?

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
m112358
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Mar 17, 2017 10:34 am
Contact:

One IP, two servers, two (sub)domains. Reverse proxy?

Post by m112358 »

Hey guys.

I'm hosting a factorio server with a couple of friends of mine. The thing is, I'm playing with and hosting for two different groups.
I know I could just simply host on two different ports, but I would prefer that people could just use some address server1.fact.com or server2.fact.com without having to remember the ports.

Do any of you know, if I can somehow set up a reverse proxy, checking what domain people are trying to connect to, and then passing the UDP packages to the right instance of factorio? I've considered NGINX, but I dont really know that much about it, and most of what I've read seems to indicate that UDP proxying can't check the target address, and perhaps cant even handle the way a game sends information.

Does anyone in here know anything about it?

Thanks
/Morten

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: One IP, two servers, two (sub)domains. Reverse proxy?

Post by daniel34 »

m112358 wrote:Do any of you know, if I can somehow set up a reverse proxy, checking what domain people are trying to connect to, and then passing the UDP packages to the right instance of factorio?
It's not possible. If you enter a domain name to connect to a server then Factorio will first resolve that domain name and then connect using ip:port, the domain name is not sent to the server. A reverse proxy would have no way to check to which instance the packet has to be forwarded.
quick links: log file | graphical issues | wiki

Neemys
Filter Inserter
Filter Inserter
Posts: 461
Joined: Sat Apr 09, 2016 6:16 pm
Contact:

Re: One IP, two servers, two (sub)domains. Reverse proxy?

Post by Neemys »

I don't know if it work and I can't give you the full line to add to your dns, but a look at that migth do what you want : https://en.wikipedia.org/wiki/SRV_record
Want more space restriction ? Or maybe you want to be forced to use train for other thing than ore and oil ? Try Building Platform Mod !

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: One IP, two servers, two (sub)domains. Reverse proxy?

Post by daniel34 »

Neemys wrote:I don't know if it work and I can't give you the full line to add to your dns, but a look at that migth do what you want : https://en.wikipedia.org/wiki/SRV_record
Factorio currently doesn't support SRV records, but it has been suggested: viewtopic.php?f=6&t=21276
Rseding91 wrote:This has been on our to-do for a while now.
quick links: log file | graphical issues | wiki

m112358
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Mar 17, 2017 10:34 am
Contact:

Re: One IP, two servers, two (sub)domains. Reverse proxy?

Post by m112358 »

Well alright then. That's a shame. But thank you for the response :)

/Morten

Post Reply

Return to “Technical Help”