Tip: NS8 traefik works fine for other servers in the LAN

It might be clear to many, but not so clear to some others:
Traefik, the reverse proxy embedded in NS8, works fine if you want to point to other services in your network (that do not belong to NS8)!

Since it already setup and VERY easy to configure (Settings/HTTP Routes), you might want to use it.
Nice. One more service I don’t have to install extra.

Can you give a clear and educational example please?

TIA

yes, would love to know hoy you implemented it in your setup

Sure.

Let’s imagine this setup:

  • My NS8 is a VM with IP 192.168.1.20.
  • I have another VM that is a game server with web interface and is on 192.168.1.10.

In my router I could either forward another port to 192.168.1.10:80 or 443 or I can just port forward all web traffic (port 80 and 443) to my NS8 and let NS8 handle the internal URL rewrite depending on actual URL used.

  • I go to my external DNS for my domain.

  • I set an entry games.mydomain.com CNAME myserver.mydomain.com (where myserver.mydomain.com points to my external IP… Can be a dyndns entry or whatever).
    Now if I type from the Internet myserver.mydomain.com or games.mydomain.com both come to my router.
    Router (at least most routers) don’t manage URLs, so it just sees it as inbound web traffic and forwards it where port forwarding 80 and 443 are forwarded in the LAN.

  • So I go to Setting/HTTP routes.

  • Create route.

  • Give it a name (games).

  • I set URL to http://192.168.10 (could also use a custom port or a / path)

  • Since in this case it is not an https link, I don’t request a certificate and I don’t convert http to https.

  • For host I set games.mydomain.com.
    Note, you could also use a path. This is very common when you don’t own a full domain (like a single host FQDN in dyndns) and it is a way to refer to it. In that case you would write for example myserver.mydomain.com and /games to path.

  • …done! It should work.

Router gets web traffic, forwards it to NS8, but the traffic itself “says” to NS8 that someone typed http://games.mydomain.com (or http://myserver.mydomain/com/games in the secondary case). NS8 now knows what to do with it.

I hope this is a clean enough example.

2 Likes

I have a Raspberry Pi running Home Assistant on my network. For that i created a HTTP-route that both handle the HTTP to HTTPS and the renewal of the Lets Encrypt certificate.
Works very well.

2 Likes

Yes, I had a separate reverse proxy service in my UNRAID (SWAG), but had several issues with it plus I have SEVERAL containers already running there and at the same time I wanted more services done by NS8 (as now it just handles mail and users) - so using it for traefic too, is great.