I’m happily serving a few websites and services publicly. Now I would like to host my Navidrome server, but keep the contents private on the web to stay out of trouble. I’m afraid that when I install a reverse proxy, it’ll take my other stuff online offline and causes me various headaches that I’m not really in the headspace for at the moment. Is there a safe way to go about doing this selectively?

32 points

That’s the standard behavior. Read the documentation for whatever reverse proxy you want to use.

permalink
report
reply
0 points

The standard is that everything gets captured by the proxy? I want to leave the HTTP and Gemini servers public. I also want those and SMB to remain accessible on the LAN.

permalink
report
parent
reply
20 points

No, the standard is that it routes only what you configure.

permalink
report
parent
reply
2 points

Wonderful. Thank you!

permalink
report
parent
reply
6 points

I just don’t put the ports on the proxy config.

permalink
report
reply
1 point

So those ports that I don’t put in the config remain publicly accessible? That would be perfect.

permalink
report
parent
reply
2 points

The ports you don’t put in are not publicly routed.

I use NPM and only have 3 services routed outside my network.

permalink
report
parent
reply

First of all, doesn’t Navidrome have authentication? So, I don’t see why exposing it to the public is a problem.

Second, some reverse proxies support basic auth. This way, you can password-protect some services and is useful if the service does not have its own authentication. Here as an example snippet for Caddy:

example.com {
	basic_auth {
		# Username "Bob", password "hiccup"
		Bob $2a$14$Zkx19XLiW6VYouLHR5NmfOFU0z2GTNmpkT/5qqR7hx4IjWJPDhjvG
	}
	reverse_proxy myservice:8000
}

You’ll have to look up the docs for other reverse proxies.

permalink
report
reply
1 point
*

Thanks. You’re right about Navidrome supporting authentication. I’m using HTTP instead of HTTPS, though. I was advised to use a reverse proxy to avoid potential legal issues.

permalink
report
parent
reply
5 points

What’s your reason for using HTTP? That seems like a really bad idea this day in age, ESPECIALLY if that’s something you’re going to make available on the internet.

permalink
report
parent
reply
2 points

They’re lightweight sites that exist to be accessed by vintage computers which aren’t powerful enough to run SSL.

permalink
report
parent
reply
2 points
*

How will a reverse proxy help?

Things that a reverse proxy is often used for:

  • making multiple services hosted on the same IP and port
  • SSL termination so that the wider world speaks https and the proxy speaks http to the server. This means the server doesn’t have to do its own key management
  • load balancing services so multiple servers can serve the same request (technically a load balancer but I believe some reverse proxies do basic load balancing)
  • adding authentication in front of services that don’t have their own (note that some of the protections/utility is lost if you use http. Anyone who can see your traffic will also be able to authenticate. It’s not zero protection though because random internet users probably can’t see your traffic)
  • probably something I’m forgetting

Do any of these match what you’re trying to accomplish? What do you hope to gain by adding a reverse proxy (or maybe some other software better suited to your need)?

Edit: you say you want to keep this service ‘private from the web’. What does that mean? Are you trying to have it so only clients you control can access your service? You say that you already have some services hosted publicly using port forwarding. What do you want to be different about this service? Assuming that you do need it to be secured/limited to a few known clients, you also say that these clients are too weak to run SSL. If that’s the case, then you have two conflicting requirements. You can’t simultaneously have a service that is secure (which generally means cryptographically) and also available to clients which cannot handle cryptography.

Apologies if I’ve misunderstood your situation

permalink
report
parent
reply
1 point

Thank you for the very informative reply.

The HTTP and Gemini services are for vintage clients, but I would like the reverse proxy to keep my media collection private (and maybe SSH and SMB too). So I’m serving to modern clients in the case of reverse proxy. I was told that port forwarding is no longer considered secure enough and that if my media gets publicly exposed I could be liable for damages to license holders.

permalink
report
parent
reply
3 points

A typical use case is to forward a single port to the proxy, then set the proxy to map different subdomains to different machines/ports on your internal network. Anything not explicitly mapped by the reverse proxy isn’t visible externally.

permalink
report
reply
3 points

I’m afraid that when I install a reverse proxy, it’ll take my other stuff online and causes me various headaches that I’m not really in the headspace for at the moment.

If you don’t configure your other services in the reverse proxy then you have nothing to worry about. I don’t know of any proxy that auto discovers services and routes to them by default. (Traefik does something like this with Docker services, but they need Docker labels and to be on the same Docker network as Traefik, and you’re the one configuring both of those things.)

Are you running this on your local network? If so, then unless you forward a port to your server on the port your reverse proxy is serving from, it’ll only be accessible from the local network. This means you can either keep it that way (and VPN in to access it) or test it by connecting directly to your server on that port and confirm that it’s working as expected before forwarding the port.

permalink
report
reply
1 point
*

Thank you so much. That clears up all my doubts. I’m running an ARM server ok the lan with port forwarding for HTTP (80) Gemini (1965) and SMB (not forwarded).

I made a typo in my original question: I was afraid of taking the services offline, not online.

permalink
report
parent
reply
2 points

I made a typo in my original question: I was afraid of taking the services offline, not online.

Gotcha, that makes more sense.

If you try to run the reverse proxy on the same server and port that an existing service is using (e.g., port 80), then you’ll run into issues. You could also run into conflicts with the ports the services themselves use. Likewise if you use the same outbound port from your router. But IME those issues will mostly stop the new services from starting - you’d have to stop the services or restart your machine for the new service to have a chance to grab the ports while they were unused. Otherwise I can’t think of any issues.

permalink
report
parent
reply
2 points

That’s reassuring. Thanks, I was struggling with the concept and where to start but I should be fine now since I’m handy enough with a terminal.

permalink
report
parent
reply

Selfhosted

!selfhosted@lemmy.world

Create post

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!

Community stats

  • 4.8K

    Monthly active users

  • 1.8K

    Posts

  • 18K

    Comments