brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: tailscale serve with a path puts several apps behind one name

Network and access
~/tips/tip-tailscale-serve-set-path

tailscale serve --bg 8080

Serve different local apps under different URL paths on one Tailscale HTTPS name.

One machine, three small web apps, and you want them all under the same HTTPS name in your tailnet. tailscale serve can split them by path.

tailscale serve --bg 8080
tailscale serve --bg --set-path /grafana 3000
tailscale serve --bg --set-path /files /srv/share

The first line sends the root to port 8080. The second maps /grafana to port 3000, and the third shows a folder as a simple file listing. tailscale serve status shows the whole mapping, and tailscale serve reset clears it.

The target can be a port, a full URL, a file or a folder, or a Unix socket on Linux and macOS, so a mix of apps and static files works fine.

The part I’d watch out for: many apps assume they live at the root. Behind /grafana they may link to /login and break. Most apps have a base URL or subpath setting for this; Grafana calls it root_url with serve_from_sub_path. If an app has no such setting, give it its own port with --https=8443 instead of a path.

To remove one mapping, the docs say to repeat the command you used with off at the end. The target may be left out, but the flags must stay: tailscale serve --bg --set-path /files off.

Further reading: tailscale serve command, Funnel and Serve use cases

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link