Reverse proxy on a private VPS

I have a private ubuntu VPS that I want to use as a reverse proxy for my minecraft server, which I run on my local machine, though I am not really familiar with linux. I know the very basics of networking and I'm just curious if anybody has a tutorial or could help me set it up. What I wanna do is to make it work basically like playit.gg but so I can control it fully
26 Replies
lavaking46
lavaking463w ago
You'll need to setup some kind of VPN to connect between the two. Iirc tailscale would probably work for this
grg
grgOP3w ago
Would I need to install the tailscale client on both machines?
lavaking46
lavaking463w ago
it looks like yes based on the docs
grg
grgOP3w ago
Could you send me a tutorial on how I go about doing that?
lavaking46
lavaking463w ago
Tailscale
YouTube
How to get started with Tailscale in under 10 minutes
How to get started with Tailscale in under 10 minutes. Personal accounts are always free on Tailscale and can include up to 3 users and 100 devices. Get started today at https://tailscale.com/yt
grg
grgOP3w ago
Is tailscale an alternative to wireguard?
lavaking46
lavaking463w ago
No, its uses wireguard as its backend
grg
grgOP3w ago
Alright, thank you, I will try it out later
iRazvan2745
iRazvan27453w ago
It’s WireGuard that only proxies connections made to the tailnet
Upioti
Upioti3w ago
Why?
grg
grgOP2w ago
I did it Took a while, but I managed to do it Thank you Though now there is another problem, the chunks load really slowly I tested the connection speed between my PC and the VPS and it's 20 Mbps, which should be more than enough The connection is also direct
lavaking46
lavaking462w ago
it's likely related to your computer specs then
Upioti
Upioti2w ago
Not really
grg
grgOP2w ago
Are you saying it's not enough? Well I have a pretty beefy PC, so I don't really know what the issue is I used playit.gg, and sometimes it worked great, but sometimes it didn't work at all, which is why I switched
TecTrix
TecTrix2w ago
cpu? ram? allocated ram?
Upioti
Upioti2w ago
Not at all 5 players joining at once or loading chunks can saturate that And keep in mind this is shared with your home network If you have parents or roommates They watch a YouTube video and say goodbye to your ping You upload/download a file and server will lag
grg
grgOP2w ago
Ryzen 7 5800x3d RAM 32 gigs, 30 allocated
TecTrix
TecTrix2w ago
You should probably allocate a little less ram
grg
grgOP2w ago
Well the thing is, when I was using playit, and when it was working properly, everybody's chunks loaded instantaniously, even though my connection was the same as it is now Maybe, I didn't have problems with it thus far though
Upioti
Upioti2w ago
I’m pretty sure their reverse proxy will have network optimizations and also the anycsst routing helps
Beef
Beef2w ago
I'm using the same setup with tailscale. Put both devices into a tailnet then use nginx to forward traffic from the VPS public ip to the tailnet interface
stream {
server {
listen 0.0.0.0:25565;
proxy_pass your.servers.tailnet.ip:25565;
}
}
stream {
server {
listen 0.0.0.0:25565;
proxy_pass your.servers.tailnet.ip:25565;
}
}
youll need a rule like this added to your /etc/nginx/nginx.conf the proxy pass ip being the tailscale ip of the device that is hosting the minecraft server
grg
grgOP2w ago
I believe I used rinetd for the same purposes, do you think nginx will be better?
Beef
Beef2w ago
Never tried rinetd but nginx is mega lightweight and works great for me. Ping me if you need help with it
grg
grgOP6d ago
Hey there, tried this now, but when I try to restart nginx it shows this error
No description
grg
grgOP6d ago
ok, I think I managed to get it working in the end It shows that the server is up, bu times out when I try to connect Nevermind, it was the server itself Holy guacamole it works And it works way better than rinetd
Beef
Beef6d ago
Glad you got it sorted :p

Did you find this page helpful?