Hi everybody.

How should I setup reverse proxy for my services? I’ve got things like jellyfin, immich a bitwarden running on my Debian server in docker. So should i install something like nginx for each of these also in docker? Or should I install it from repository and make configs for each of these docker services?

Btw I have no idea how to use something like nginx or caddy but i would still like to learn.

Also can you use nginx for multiple services on the same port like(443)?

  • ohshit604@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 hour ago

    Reverse proxying was tricky for me, I started with Nginx Proxy Manager and it started out fine, was able to reverse proxy my services in the staging phase however, once I tried to get production SSL/TLS certificates it kept running into errors (this was a while ago I can’t remember exactly) so that pushed me to SWAG and swag worked great! Reverse proxying was straight forward, SSL/TLS certificates worked well however, overall it felt slow, so now I’m using Traefik and so far have no complaints.

    It’s honestly whatever works for you and what you prefer having.

  • Agosagror@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 hours ago

    Since your a beginner, youll find nginx proxy manager easiest, it has a nice ui, and at this stage you are probably less intrested in the 10/10 fastest lighweight setup and more intrested in getting stuff working.

  • monogram@feddit.nl
    link
    fedilink
    English
    arrow-up
    14
    ·
    6 hours ago

    Caddy

    It’s three lines of configuration

    jellyfin.example.com {
      reverse_proxy http://localhost:8083/
    }
    

    Automatic https with let’sencrypt, simplicity of a single binary, downgrade is as simple as replace binary & restart service.

      • HelloRoot@lemy.lol
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        4 hours ago
        1. you rent a domain

        2. in the config (provided by the service where you rented the domain) you set it to point to the IP of the device where you run caddy

        3. the service tells the relevant global DNS servers your setting

        4. your DNS does a DNS lookup and a DNS server returns the IP you configured it to point to


        Depending on the DNS you use, you can manually add entries to do 1-3 differently, but that will only work for devices that use your DNS and is hard.

        • beeng@discuss.tchncs.de
          link
          fedilink
          English
          arrow-up
          2
          ·
          3 hours ago

          Is this a local address or a public IP address?

          I just want the resolving internal to my network but I never got it working right.

          • PlexSheep@infosec.pub
            link
            fedilink
            English
            arrow-up
            1
            ·
            55 minutes ago

            If you want DNS only in your LAN, you need to self host a DNS server and register this domain locally (by putting it in some config file of yours)

          • Scrath@lemmy.dbzer0.com
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            2 hours ago

            I’m not the guy you replied to but personally I use a setup called split-horizon DNS.

            1. I have a DNS server running on a raspberry pi which I have set up as the DNS server for all devices in my local network (by setting it in the router).
            2. This DNS server has my domain name as an A record pointing to my reverse-proxy (Nginx Proxy Manager), e.g. example.com would resolve to 192.168.0.100.
            3. Any subdomain I want to use is set up as a CNAME record in my DNS server referring to the previously configured A record with my domain. (jellyfin.example.com => example.com)
            4. Now all requests to the registered domain and subdomain are routed to my reverse-proxy which I configured to forward them to the correct service depending on the given subdomain.

            This is a little bit of a simplification. I also use a cloudflare tunnel to allow access to select subdomains and I have 2 reverse-proxies chained together since NPM can resolve services by their container name as long as they are in the same docker network.

            Also probably important: My DNS server was a pi-hole (until today at least) and did not act as my DHCP server. This meant it had no idea of local device hostnames and therefore was configured to forward queries to local device names to my routers built-in DNS server.

            The domain I use for my services is one I rent from a registrar so that I can get valid SSL certificates without self-signing them. If you are fine with self-signed certificates or simple http you probably don’t need to do that.

          • themadcodger@kbin.earth
            link
            fedilink
            arrow-up
            1
            ·
            2 hours ago

            I’ve got the external IP addresses down pat. I’m with you in that I’ve never quite figured out how to do the same with local IP addresses.

  • 👍Maximum Derek👍@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    9
    ·
    edit-2
    3 hours ago

    I use Nginx Proxy Manager running as a docker container. Its a gui that makes administration more straight forward. It points at all my services (docker and otherwise) and handles the SSL for me. Because I don’t want to have any ports open I use DNS challenge ACME and NPM has built in support for a number APIs from large public DNS providers to automate that.

  • irmadlad@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    5 hours ago

    I recommend Caddy. It’s very easy to deploy, and configuring it is a snap. This tutorial helped me out a bunch. There is a Docker version of Caddy, tho I have never used it. I figured, Caddy would do better installed on bare metal. I use Caddy in conjunction with Duckdns.org. Caddy also takes care of renewing your certs when it’s time.

  • iAmTheTot@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    5
    ·
    6 hours ago

    Nginx Proxy Manager was easy to learn as a beginner. I’d recommend it as a learning tool, if nothing else, and if you want to switch to other solutions later you can.

  • Zozano@aussie.zone
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    6 hours ago

    IMO, look into the linuxserver.io fork of NGINX, called SWAG.

    It comes preloaded with a bunch of fantastic addons for security.

    Quite easy to get set up, if you’ve got an idea about how it works.

  • y8h8do3a2vg5@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    7 hours ago

    This may be a controversial approach, but I recently had to set up reverse proxy along with DNS configuration and certificate handling. I pair programmed with an LLM.

    My experience was this… I described what I wanted to set up, my objectives (like containerisation, zero touch deployment, idempotence, etc) and it gave me a starting point. It threw a few bad ideas in but I also asked it to help me stress test against the objectives. I think it’s all just about working now. I learned a lot about shell, docker, nginx, terraform, VM metadata, data persistence, pulling it all in from a git repo, bootstrapping nginx with self-signed certificates, auto renewal, vscode devcontainers and more. Honestly I’m worried about what a pro would make of my code, but I made huge steps in a relatively short time. Disclaimer: I am a software engineer who was keen to learn this stuff and get moving quickly.

    I would definitely consider this approach if you’re new to the area.

    • Flamekebab@piefed.social
      link
      fedilink
      English
      arrow-up
      6
      ·
      edit-2
      7 hours ago

      Yeah, another vote for Caddy. I’ve run nginx as a reverse proxy before and it wasn’t too bad, but Caddy is even easier. Needs naff-all resources too. My ProxMox VM for it has 256 MB of RAM!

    • Octavusss@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      8 hours ago

      I’ll definitely take a look at so thx. Also I’m using duckdns right now so i didn’t need to port forward anything but if I use my domain do i need to port forward ports 80&443 from through my router to my debian server (192.168.200.101)?

      • walden@sub.wetshaving.social
        link
        fedilink
        English
        arrow-up
        3
        ·
        7 hours ago

        To access things outside of your LAN (for example from your phone while at the grocery store), each service gets a DuckDNS entry. “service.myduckdns.com” or whatever.

        Your phone will look for service.myduckdns.com on port 443, because you’ll have https:// certificates and that all happens on port 443.

        When that request eventually gets to your router and is trying to penetrate your firewall, you’ll need 443 open and forwarded to your Debian machine.

        So yes, you have it right.

        Also forward port 80.

      • WhatAmLemmy@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        8 hours ago

        You can also choose a mesh vpn like tailscale and then you don’t have to worry about ddns or port forwarding at all, ace you can still use a reverse proxy.

        • Octavusss@lemm.eeOP
          link
          fedilink
          English
          arrow-up
          3
          ·
          8 hours ago

          I mean i have a wireguard on my router but how can I point the domain from my provider like (godaddy) to my server without opening ports?

  • Sean@infosec.pub
    link
    fedilink
    English
    arrow-up
    9
    ·
    8 hours ago

    I prefer doing nginx on the host (vs a container), & have different configs for each service. You can have multiple services on the same port, it can be controlled via DNS instead (i.e.: access Jellyfin.domain.com & bitwarden.domain.com, both of 443).

    Ive tried Caddy once or twice but couldn’t get it working, so i just stick with nginx & cert or to automatically get certificates from my internal CA

    • Avid Amoeba@lemmy.ca
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 hours ago

      I’m doing the same with Apache in a container. Using Let’s Encrypt with DNS challenge for SSL certificate. The DNS records point to the reverse proxy IP which is only accessible via VPN (Tailscale). 😂

      • Sean@infosec.pub
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 hours ago

        nginx + certbot \ acme for certs from my local Step-CA, proper DNS & I just use a WireGuard VPN on-demand for when I leave my house. As soon as I’m off my Wi-Fi I have the VPN active so I don’t need to expose anything more than 1 port for that to work =]

        I might look at Tailscale, if only because I’ve seen plenty of people say that’s how they connect, so worth looking into =]

        • Avid Amoeba@lemmy.ca
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          4 hours ago

          If you want to stay fully self-hosted, look into Headscale. You could run it locally with a port open, or you could throw it on the tiniest cloud VM somewhere and have zero ports open at home.

    • Octavusss@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      8 hours ago

      Yeah but when I last tried nginx on my bitwarden host and another on my jellyfin host i could access the one for bitwarden on port 81 of my server but couldn’t access the other nginx web page on port 85 even though i have written it in docker compose file and the port 85 was also open on my server.

      • Sean@infosec.pub
        link
        fedilink
        English
        arrow-up
        4
        ·
        8 hours ago

        It looks like jhdeval mentioned this already, but you may need to review your config file. By default, you would likely have nginx listening on ports 80 & 443 for requests to a specific address (i.e.: jellyfin.domain.com) which would be configured in your DNS, & then nginx would direct the jellfin 443 traffic to port 85 to access Jellyfin. Same principle for Bitwarden. If you have your nginx config files, i \ we could take a look & see if we spot any issues.

        • Octavusss@lemm.eeOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          8 hours ago

          I’m currently cannot post it here and also since it didn’t work the first time I’m using only http for jellyfin and immich but i can later post the docker config for bitwarden.

  • Encrypt-Keeper@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    7 hours ago

    What is your goal, simplest to configure? industry standard? Secure options set by default? Do you need a gui or are you fine with config files?

    • Octavusss@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      7 hours ago

      Something secure and easy to understand and setup for beginner. The easier the better. I don’t mind writing config files if I can understand it.

  • rasterweb@fedia.io
    link
    fedilink
    arrow-up
    2
    ·
    7 hours ago

    I was new to doing reverse proxy stuff but Nginx Proxy Manager made it really easy. A bit of doc reading, I probably watched a video or two, and it all made sense. Great clean UI and easy to install. (I run it on a Raspberry Pi.)