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?

  • ngn@lemy.lol
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 months ago
    • simple config & setup
    • good performance
    • popular/packaged by every single distro
    • just works
  • wjs018@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 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
  • kolorafa@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 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.

  • Shimitar@feddit.it
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    Nginx “just works™” had never got into the way, its been rock solid and has not changed significantly over the years.

    Why would I need something else?

  • tills13@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    Caddy’s developer gives me the ick. He’s way too pompous in PRs on GH. nginx is just a constant – it does exactly what you need to and does it well.

  • MangoPenguin@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    It just works and it’s in every distros default repo, it’s pretty easy to set up and can be a webserver for static files, PHP sites, etc… It can be a reverse proxy for HTTP(s) traffic or just forward TCP/UDP.

    There’s also endless documentation out there for how to do something in nginx.

    HAProxy is a nightmare to use in my experience. It just feels so clunky and old.

    Caddy is nice, but downloading and updating it is a pain because you need modules that aren’t included in the repo version.

    • ____@infosec.pub
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      Right there with you on “just works,” as well as the simple fact that the config snippets you need are readily available - either in the repo of whatever you’re putting behind the proxy, or elsewhere on the internet.

      I consistently keep in mind that it’s ultimately an RU product, of course. But since it’s open source and changes relatively infrequently, that’s mitigated to a large degree from where I sit.

      Nothing against Caddy, though Apache gets heavy quickly from a maintenance standpoint, IMHO. But nginx has been my go to for many, many years per the above. It drops into oddball environments without having to rip and tear existing systems out by the roots, and it doesn’t care what’s behind it.

      Ages ago, I had a Tomcat app that happened to be supported indirectly by an embedded Jetty (?) app that didn’t properly support SSL certs in a sane way on its own.

      That was just fine to nginx and certbot, the little-but-important Jetty app just lived off to the side and functionally didn’t matter because with nginx and certbot, nothing else gave a crap - including the browser clients and the arcane build system that depended on that random Jetty app.

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

    There’s a lot of good resources for Nginx, it’s fast (faster than Caddy), and has a ton of features, so you can use it for pretty much anything HAProxy, Apache, or Caddy can do, and not sacrifice much in performance.

    That said, I mostly use HAProxy and Caddy. Here’s my basic setup:

    1. HAProxy at the edge VPS - routes requests to machines based on SNI
    2. WireGuard VPN - connects my internal devices to my VPS
    3. Caddy in Docker - runs on internal network on my NAS/homelab - manages LetsEncrypt renewals and reverse proxies to internal Docker network
    4. Nginx in Docker - FE for NextCloud; this simplifies things so all my TLS is handled in one place, and Caddy doesn’t need to touch files

    I use a local DNS server on my router so my domains can route directly to Caddy instead of going over the internet when on my network, otherwise I may just have HAProxy handle LetsEncrypt certificates.

    From what I can tell, Nginx is a little more efficient than Caddy, but Caddy is plenty fast for my needs. I’m considering switching from NextCloud to the new ownCloud Infinite Scale, and if I do, I’d ditch nginx completely.

  • ruse8145@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months ago

    Caddy certainly was the easier option but it’s as complex as nginx now and id argue it’s hard to to use.

  • miau@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 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?

  • hendrik@palaver.p3x.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 months ago

    It’s easy to use, reliable, and doubles as a webserver so I only need one software to host my websites and also do the reverse proxying to the other webservices.

  • Decronym@lemmy.decronym.xyzB
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 months ago

    Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

    Fewer Letters More Letters
    CA (SSL) Certificate Authority
    DNS Domain Name Service/System
    HTTP Hypertext Transfer Protocol, the Web
    HTTPS HTTP over SSL
    IP Internet Protocol
    NAS Network-Attached Storage
    NAT Network Address Translation
    SSL Secure Sockets Layer, for transparent encryption
    TCP Transmission Control Protocol, most often over IP
    TLS Transport Layer Security, supersedes SSL
    UDP User Datagram Protocol, for real-time communications
    VPN Virtual Private Network
    VPS Virtual Private Server (opposed to shared hosting)
    nginx Popular HTTP server

    [Thread #888 for this sub, first seen 26th Jul 2024, 04:25] [FAQ] [Full list] [Contact] [Source code]

    • onlinepersona@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      arrow-down
      1
      ·
      2 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

  • udon@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    Counter question: Why does everyone call it “engine X” and not “enjinx”, which would be the way cooler pronunciation?

    • Dave.@aussie.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      2 months ago

      Directly from the nginx home page:

      nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server, originally written by Igor Sysoev.

  • solberg@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I think a lot of people just haven’t heard of Caddy. Since I’ve found it I haven’t used anything else.

    • onlinepersona@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      arrow-down
      1
      ·
      2 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