Hello people, I recently rented a vps server from OVH and I want to start hosting my own piefed instance and a couple other services. I am running debian 13 with docker, and I have nginx proxy manager almost set up. I want to set up subdomains so when I do social.my.domain it will go to my piefed instance, but how do I tell the machine to send piefed traffic to this subdomain and joplin traffic (for example) to another domain? Can I use nginx/docker natively for that or do I have to install another program. Thanks for the advice.

  • just_another_person@lemmy.world
    link
    fedilink
    English
    arrow-up
    33
    ·
    7 hours ago

    It’s called a Reverse Proxy. The most popular options are going to be Nginx, Caddy, Traefik, Apache (kinda dated, but easy to manage), or HAProxy if you’re just doing containers.

    • kumi@feddit.online
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 hours ago

      HAProxy if you’re just doing containers

      What makes you say that? From my experience、HAProxy a very competent, flexible, performant and scalable general proxy. It was already established when Docker came on the scene. The more container-oriented would be Traefik (or Envoy).

      • just_another_person@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 hours ago

        HAProxy is not meant for complex routing or handling of endpoints. It’s a simple service for Load Balancing or proxying alone. All the others have better features otherwise.

          • just_another_person@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 hour ago

            For starters: Rails, PHP, and passthrough routing stacks like message handlers and anything that expects socket handling. It’s just not built for that, OR session management for such things if whatever it’s talking to isn’t doing so.

            It seems like you think I’m talking smack about HAProxy, but you don’t understand it’s real origin or strengths and assume it can do anything.

            It can’t. Neither can any of the other services I mentioned.

            Chill out, kid.

            • kumi@feddit.online
              link
              fedilink
              English
              arrow-up
              1
              ·
              edit-2
              15 minutes ago

              One related story: I did have the arguable pleasure to operate a stateful Websockets/HTTP2-heavy horizontally scaled “microservice” API with Rails and even more Ruby, as well as gRPC written in other stuff. Pinning of instances based on auth headers and sessions, weighting based on subpaths, stuff like that. It was originally deployed with Traefik. When it went from “beta” stage to having to handle heavier traffic consistently and reliably on the public internet, Traefik did not cut it anymore and after a few rounds of evaluation we settled on HAProxy, which was never regretted IIRC. My friends company had it in front of one of the countries busiest online services at the time, a pipeline largely built in PHP. Fronted with haproxy. I have seen similar patterns patterns play out at other times in other places.

              Outside of $work I’ve had them all running side by side or layered (should consolidate some but ain’t nobody got time for that) over 5+ years so I think I have a decent feel for their differences.

              I’m not saying HAProxy is perfect, always the best pick, or without tradeoffs. It does take a lot more upfront learning and tweaking to get what you need from it. But I can’t square your claims with lived experience, especially when you specifically contrast it with Traefik, which I would say is easy to get started with, has popular first-class support for containers, and loved by small teams - but breaks at scale and when you hit more advanced use-cases.

              Not that any of the things either of us have mentioned so far is releveant whatsoever for a budding homelabber asking how to do domain-based http routing.

              I think you are just baiting now.

    • cecilkorik@lemmy.ca
      link
      fedilink
      English
      arrow-up
      7
      ·
      5 hours ago

      FWIW I don’t find Apache dated at all. It’s mature software, yes, but it’s also incredibly powerful and flexible, and regularly updated and improved. It’s probably not the fastest by any benchmark, but it was never intended to be (and for self-hosting, it doesn’t need to be). It’s an “everything and the kitchen sink” web server, and I don’t think that’s always the wrong choice. Personally, I find Apache’s litlte-known and perhaps misleadingly named Managed Domains (mod_md/MDomain) by far the easiest and clearest way to automatically manage and maintain SSL certificates, it’s really nice and worth looking into if you use Apache and are using any other solution for certificate renewal.

      • just_another_person@lemmy.world
        link
        fedilink
        English
        arrow-up
        6
        ·
        5 hours ago

        I’ll be honest with you here, Nginx kind of ate httpd’s lunch 15 years ago, and with food reason.

        It’s not that httpd is “bad”, or not useful, or anything like that. It’s that it’s not as efficient and fast.

        The Apache DID try to address this awhile back, but it was too late. All the better features of nginx just kinda did httpd in IMO.

        Apache is fine, it’s easy to learn, there’s a ton of docs around for it, but a massively diminished userbase, meaning less up to date information for new users to find in forums in the like.

        • Black616Angel@discuss.tchncs.de
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 hour ago

          Apache has the better open source tooling IMO.

          I use both, but at work I prefer apache simply for its relative ease of setting up our SSO solution. There is probably a tool for that in nginx as well, but its either proprietary or hard to find (and I did try to find it, but setting up and learning apache and then SSO was actually easier for me).