How do i get to use subdomain as server address for valheim or other gaming services? reddit / selfhosted ---------------------------------------------------------------------- MaleficentArgument51 · 2023-10-02 11:29 Currently i have nextcloud and foundry running using Nginx proxymanger so i have. [nextcloud.example.org](https://nextcloud.example.org) and [foundry.example.org](https://foundry.example.org) working . How can i do like [minecraft.example.org](https://minecraft.expample.org) to work? So that i could map subdomains to certain gaming servers. So the players could just write [valheim.example.org](https://valheim.example.org) instead of public ip when joining a server. ---------------------------------------------------------------------- imCluDz · 2023-10-02 12:02 you can do that with TCP/UDP routing on traefik for example ---------------------------------------------------------------------- NikStalwart · 2023-10-02 12:32 > How can i do like minecraft.example.org to work? Valheim is a game. Most games do not use HTTP traffic. Your reverse proxy is primarily used for HTTP traffic.\* These two things are unrelated. You can set up _tcp and _udp SRV records in your DNS to point clients to alternative ports, so that you can use non-standard game ports. Check your game's documentation for the specific records you need to set. \* When I say this, do keep in mind that nginx can proxy other traffic using the Stream module. But you really do not need to do this. The point of a HTTP reverse proxy is so that you can host multiple web services behind the same web port. But games are going to be using diferent ports anyway.... ---------------------------------------------------------------------- jasonweiser · 2023-10-02 12:39 You could probably just have valheim.example.org point to your server and give that address out. Like someone else said, you can't really route Minecraft/Valheim traffic through http, but that should have the same basic effect as long as the right ports are open. I know Minecraft auto-adds the default port and I think Valheim does as well, so it would all look the same to the end user. ---------------------------------------------------------------------- Faetan · 2023-10-02 13:24 Use DNS? I just use my BIND server and create a records under the parent domain Eg minecraft.chickentendiesgaming.com Valheim.chickentenditesgaming.com ---------------------------------------------------------------------- CC-5576-03 · 2023-10-02 15:36 If you only have one server for each game and use the default port you don't need any reverse proxy or srv records, just create ak A record pointing to your ip. ---------------------------------------------------------------------- CC-5576-03 · 2023-10-02 15:38 If you have a static IP then you just create an A record pointing to that ip. If you have a dynamic IP you need to use a ddns service, create a cname record that points to the ddns domain. This will only work if you just have one server per game and if you use the default port ---------------------------------------------------------------------- lesigh · 2023-10-02 15:48 Create a DNS a record pointing to your IP. Simple ---------------------------------------------------------------------- GolemancerVekk · 2023-10-02 16:33 OK so first some background. Game traffic doesn't carry domain information like HTTP does. When a browser connects to different subdomains (like nextcloud. vs foundry.) Nginx can look at the request and see the subdomain, so it knows where to route it. But when a game client connects to valheim. or minecraft. Nginx can't get anything useful out of the request, so it doesn't know what to do. This means that if you only have one public IP available then there's no point using different subdomains for games. You can tell players to use game.example.org for all the games, or just example.org, and it will make no difference (they can also use nextcloud and foundry too). You just forward the appropriate ports for each game in your router or firewall and that's it. You don't even need Proxy Manager because it doesn't add anything useful, just forward directly from router to the game service. What you *can* do to make this work is to use a tunnel from a service like Cloudflare or Tailscale. Cloudflare calls them transport layer Cloudflare Tunnel (SSH/RDP); Tailscale calls it Tailscale Funnel. With Cloudflare you have to use their nameservers for your domain if you want to use it; with Tailscale you have to use a subdomain of their domain. In both cases you have to install their tunnel daemon on your machine (cloudflared or tailscaled) which will create an *outgoing* encrypted tunnel to Cloudflare/Tailscale (that's right, outgoing, so it doesn't matter if you're behind NAT or don't have a public IP). On their end, Cloudflare/Tailscale map the subdomain to a public IP and direct connections from the public Internet down the tunnel to your machine. You can have the tunnel client tie your end of the tunnel to the machine's public interface and also have the game servers listen there; or you can put the tunnel client in a docker container and forward to the game server (which can be in the same container, or a different container, or on the host machine's LAN interface). ---------------------------------------------------------------------- ZaxLofful · 2023-10-02 17:30 DNS entries and port forwarding ---------------------------------------------------------------------- waterslurpingnoises · 2023-10-02 18:29 My http/web traffic is served by nginx. For my game server, I route through the domain (A record) and expose the game port. This way I can have eg. play.mydomain.com or something. ---------------------------------------------------------------------- ProbablePenguin · 2023-10-04 13:13 Create a DNS record for `valheim.example.org` pointed to the server IP.