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?

  • catloaf@lemm.ee
    link
    fedilink
    English
    arrow-up
    14
    ·
    6 hours ago

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

  • tko@tkohhh.social
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 hours ago

    A reverse proxy is basically a landing place that acts as a middle man between the client and the server. Most people set it up so that all traffic on 80 or 443 go to the reverse proxy, and then the reverse proxy gets the correct website based on the host header of the request.

    If you are currently serving multiple websites on your server, then that means you are serving each website on a different port.

    So, just make sure that the reverse proxy is serving on a port that is not used by your other sites. It will only respond on it’s own port, and it will only serve the site(s) that you have configured in the proxy.

    You’ll be fine!

  • hedgehog@ttrpg.network
    link
    fedilink
    English
    arrow-up
    3
    ·
    6 hours ago

    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.

    • FarraigePlaisteach@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      5 hours ago

      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.

      • hedgehog@ttrpg.network
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 hours ago

        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.

        • FarraigePlaisteach@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          4 hours ago

          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.

  • AbouBenAdhem@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    6 hours ago

    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.

  • Foster Hangdaan@lemmy.fosterhangdaan.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    6 hours ago

    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.

    • FarraigePlaisteach@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      4 hours ago

      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.

      • tko@tkohhh.social
        link
        fedilink
        English
        arrow-up
        5
        ·
        3 hours ago

        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.

          • tko@tkohhh.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 hour ago

            Gotcha… as long as you understand that any device that receives that traffic can see exactly what’s in it! (no sarcasm intended at all… if you’re informed of the risk and OK with it, then all is well!)