I spent all day today trying to get the routing to work correctly between Tailscale, Nginx and Adguard.

Basically I wanted to be able to be able to use **http://immich.network ** to route to 192.168.1.2:9000

I wanted to share the steps I took so people don’t have to go through what I did.

First a few things Local Server IP: 192.168.1.2

  1. I installed Ngnix and Adguard, in a Docker Containers, and gave Adguard IPs 3000, 3001 instead of 80 and 443 because Ngnix took it.
  2. I went to my router and made it use the DNS: 192.168.1.2
  3. I configured Proxy Host in Ngnix … immich.network => 192.168.1.2:9000
  4. I configured DNS rewrite in Adguard … *.network => 192.168.1.2

At this point I was able to use http://immich.network finally. I installed Tailscale to be able to access when I’m outside but http://immich.network didn’t work.

These helped me https://tailscale.com/kb/1019/subnets + https://tailscale.com/kb/1054/dns?q=global+nameserver

  1. I created a subnet… tailscale up --advertise-routes=192.168.1.0/24
  2. I approved it on Tailscale login

At this point I was able to access home server using its local IP 192.168.1.2 but I couldn’t get http://immich.network to work.

  1. I created a nameserver dns with split DNS but I used my local ip… 192.168.1.2 => network

Finally everything is working… I have a feeling that I’m doing it wrong but I’m too tired and it’s finally working.

  • LifeBandit666@feddit.uk
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 months ago

    I’ve been wanting to do exactly what you’re doing here on my LAN for a while. I tried to do it on Friday using Zoraxy and managed to get Homarr running on server.local but couldn’t get anything else running with a name (overseerr.server.local and server.local/overseerr just wouldn’t work, although I did get a webpage on server.local/overseerr it wouldn’t resolve properly).

    Anyway as to your second point of getting a nameserver in Tailscale. While I haven’t managed to get a nameserver in Tailscale I have managed to get apps running through Tailscale.

    My app was Audiobookshelf. I wanted to be able to just turn on Tailscale on my phone and sync to Audiobookshelf and managed to do just that.

    I already connected Audiobookshelf at home with it local IP.

    I then spun up a Tailscale container in the docker host that Audiobookshelf was on, signed in to it on the Tailscale dash, then just added the Tailscale network in Docker to the Audiobookshelf docker container.

    Now I can turn on Tailscale when I’m out of the house and open Audiobookshelf app and it connects to my.home server.

    Meaning I don’t need to remember the IP address and portz I set that up once in the Audiobookshelf app and connect to it at will.

    I intend to have a go at attaching it to Syncthing next. I don’t have much use case for Syncthing at present so it’s a perfect app to experiment with. I intent to just attach the Tailscale network to my Syncthing container and just see if it connects. Then I’ll try syncing my Keepass database to my host as an experiment from my phone.

    In my head it should be that simple. If it is I’ll just connect all my docker apps that way and spin up another Tailscale instance on my other VM that does my Arr, and I’ll have outside access to everything.

    Another point to give you for your quest: if you set up Heimdall and a Tailscale exit node, you can put all your self hosted apps in Heimdall for ease of access and then just hit that through your Tailnet. I have a shortcut on my phone home page. You can then just click the service you want in Heimdall and go to that service.

    Edit: turned off the exit node I had running inside Home Assistant and now nothing works. Turns out it wasn’t as easy to connect to the Tailnet as I thought, and I must have been hitting audiobookshelf through my Tailscale exit node after all. But that does mean that my final paragraph still stands, exit node plus a home page (Heimdall, Homarr) gives the same results, but without the nameservers.

    • Mir@programming.devOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 months ago

      Now I can turn on Tailscale when I’m out of the house and open Audiobookshelf app and it connects to my.home server.

      I did all this because I wanted to use the same address for home and tailscale

      Heimdall

      I think that’s what I’m currently doing with Homarr