this post was submitted on 20 Aug 2023
45 points (94.1% liked)

Selfhosted

39256 readers
176 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Currently my home server runs a few services that have a web UI. I currently access them by typing in the IP address and port number, but it’s now starting to get annoying to remember the ports.

What’s the best way to handle this?

I’ve thought of two solutions:

  1. I’m running a local DNS server, so I probably would be able to make CNAMEs from something like adguard.server.local to the IP, and do a reverse proxy with something like Caddy
  2. Maybe there’s some unified dashboard app that is a reverse proxy with some simple frontend where I can just navigate to server.local and click a button to choose which specific service I want to see?

What are your opinions on this?

you are viewing a single comment's thread
view the rest of the comments
[–] lal309@lemmy.world 3 points 1 year ago

If you are running everything in containers then there’s a very simple and straightforward solution for this. Run your reverse proxy (NPM, Caddy, whatever) on two network (internal and external or whatever you want to call them). In the external network is where you will map your host port to the reverse proxy container. For example, on NPM it’s 81 so you map host 81 to container 81. You should then be able to go to http://localhost:81. The internal network will be where your reverse proxy will talk to your other two web services you want to run so make sure you add your other services to this internal network.

On your DNS (personally I run PiHole) point your service name (as guard) to the IP of the host running your reverse proxy. Do an nslookup on the name to make sure you actually get the right IP for the name you want.

Login to your reverse proxy and configure a proxy host to point to the name of the container and the correct port. Since the reverse proxy is on the same “internal” network, they should be able to talk to each other via names rather than IPs.

Test your connection to the service on your browser.

Another solution (less technical but much faster) would be to runa dashboard service like Heimdall then just add a “link” to the service you want and the port it’s running on. Then you will have a single link to click on that will take you where you want without typing manually. You could even add the dashboard as your browser default page on startup.

There are other ways to skin this cat but these two solutions will get you where you want to go quickly.