I see so many posts and people who run NGINX as their reverse proxy. Why though? There’s HAProxy and Apache, with Caddy being a simpler option.

If you’re starting from scratch, why did you pick/are you picking NGINX over the others?

  • @miau@lemmy.sdf.org
    link
    fedilink
    English
    19 months ago

    Honest question: why not use nginx?

    I have run it in so many different scenarios, both professionally and personally, its crazy. Nginx has never failed me, literally. My homeserver is quite limited but nginx has a very small footprint, it performs beautifully well and it satisfies all my hosting, proxying, redirecting and streaming needs.

    It works for modern and legacy applications, custom code, webhosting, supports all the modern features and its configuration is very easy with literal thousandsof examples available online.

    Apache probably can do all that but I hate how unintuitive its configuration is to me personally. HAproxy cant do half the stuff nginx does.

    As for caddy Ive heard of it but never really used it. What does it offer that nginx doesnt?

  • @atzanteol@sh.itjust.works
    link
    fedilink
    English
    59 months ago

    Nginx scales better than Apache does for static content and proxying, so it started to take over market share.

    A home gamer handling a handful of users is unlikely to ever notice a difference.

    But the configuration for nginx is simpler nout of the box for most things which is probably the real reason people use it at home.

  • @brygphilomena@lemmy.world
    link
    fedilink
    English
    29 months ago

    I learned nginx when I was hosting websites. I had it set up and running when it was time to add reverse proxies into my setup. It didn’t take much more from the virtual hosts I was already using.

    Now, I don’t host many individual sites anymore and haproxy has a plugin on my firewall for the handful of services I run now.

  • @catloaf@lemm.ee
    link
    fedilink
    English
    109 months ago

    nginx has more features and flexibility than haproxy, such as being a web server. If I wanted just a pure proxy, I’d use haproxy. Apache is primarily a web server, and a pain to configure.

    Personally I use Traefik. Add it to docker-compose, set up LE certs, add a few lines to each container, and it Just Works. No extra config on Traefik itself.

    • @onlinepersona@programming.dev
      link
      fedilink
      English
      49 months ago

      Apache still is a pain in the ass. The only guide I found useful were from 20 years ago or so. All “modern” ones I found didn’t explain stuff, but were more like “copy paste this, now you’re done”. They never fit my usecase.

      I honestly don’t know why people new to webhosting even bother with Apache when NGINX is around. It’s just so much easier.

      Anti Commercial-AI license

  • Magiilaro
    link
    fedilink
    English
    6
    edit-2
    9 months ago

    Because I have it in use as my main webserver, sure I could put that behind haproxy too but why? I like to keep my server setup small and easy, without unnecessary duplications. Nginx can everything that haproxy can, and more.

  • Faceman🇦🇺
    link
    fedilink
    English
    49 months ago

    NGINX is a bit more hands on than some other options but it’s mature, configurable and there’s a huge amount of information out there for setting it up for various use cases.

    in my case, its what I set up when i was first getting into this and it works, so I don’t want to go through setting up anything else.

  • Eager Eagle
    link
    fedilink
    English
    6
    edit-2
    9 months ago

    Nginx handles more connections than Apache, given the same resources. HAProxy does not have web server functionality like the former two, so Nginx is the natural upgrade from Apache. Caddy is relatively new, I’m not sure how it compares other than being easier to set up.

  • @apprehentice@lemmy.enchanted.social
    link
    fedilink
    English
    13
    edit-2
    9 months ago

    nginx is mature and has a lot of support online. A lot of server projects assume you’re using nginx, as well. I’ve only ever seen caddy instructions on newer projects and even then, they usually also have nginx instructions.

    Plus, I already know how to use it.

    • @onlinepersona@programming.dev
      link
      fedilink
      English
      -29 months ago

      It might be worth looking more deeply into. From a cursory glance, it might be usable for my usecase, but many service have configuration examples for NGINX (or Apache if they’re old). I’ve never seen caddy examples. What has your experience been with adapting those examples to caddy?

      Anti Commercial-AI license

      • Encrypt-Keeper
        link
        fedilink
        English
        19 months ago

        Caddy is so simple you don’t really need configuration examples. The extra configuration many docker services have you configure in Nginx are already done by default with Caddy. Though I have seen Caddy config examples around sometimes.

        If all you’re using it for is reverse proxying, you don’t need config examples for Nginx or Caddy, just understand how to configure them.

  • @kolorafa@lemmy.world
    link
    fedilink
    English
    66
    edit-2
    9 months ago

    Because Nginx Proxy Manager exists.

    And also because for me it started from web hosting where Apache and Nginx dominate and later because of many easy to understand example configs from the net including many “docker letsencrypt” examples.

    • @Takahe@lemmy.nz
      link
      fedilink
      English
      179 months ago

      Very much became it exist. Its way simpler to do in the GUI.

      Did not have to learn anything specific, and can work for things not in docker containers too, like the Nextcloud Snap.

      • lemmyvore
        link
        fedilink
        English
        129 months ago

        And it makes it very easy to get and maintain certificates.

  • @wjs018@lemmy.world
    link
    fedilink
    English
    829 months ago

    Some good answers in here already. It boils down to a couple points for me:

    • Back when I started selfhosting, it was either nginx or apache, and I found nginx better and easier to set up
    • All the nginx knowledge I learned years ago still works just the same as it did back then, so why potentially mess things up by switching if it all still works
    • Basically every project has an example nginx config for reference, that can’t be said about other proxies
    • It is easier to find support online for edge cases that might pop up with nginx due to the ubiquity of its use and years of history
  • @tombond@lemmy.world
    link
    fedilink
    English
    39 months ago

    Me personally, as a newb regarding proxy and homelab, I use nginx because it was super easy to set up (proxmox script) there were many tutorials available and it just works great. I had to debug some things and this also worked great, so just a perfect package.