5 ms·
Nginx is not a web server. Nginx is a reverse-proxy. Nginx's sees a massive share of its usage as a web server, sure, but – from the very beginning – it was al
by pritambaral 11y ago
Nginx is not a web server. Nginx is a reverse-proxy.
Nginx's sees a massive share of its usage as a web server, sure, but – from the very beginning – it was always intended to be a good reverse-proxy.
Apart from http, nginx also supports mail (imap, pop3, smtp), stream sockets (tcp and unix), and few third-party ones too (like rtmp). And now, UDP as well.
One of most needed features expected of a good reverse-proxy is load-balancing. Nginx is already quite good at it, but lacked UDP load balancing (like HAproxy – another reverse-proxy – does). That is no longer the case, and I'm sure the people that have asked HAproxy to support UDP will be pleased that nginx does it now.
- MichaelGG 11y agoI suppose its support for static content and other HTTP-ish-server features mislead people. I use it, saw the mail stuff and figured it was "weird". Had no idea it could do general TCP proxying.
- hrez 11y agoFor reverse-proxy/LB it kinda sucks. No standard healthchecks for a long-long time and nowdays only in commercial version? Yes, you can compile in 3d party plugin but that just underscores the lacking.
- Forbidden 11y agoYou're completely wrong. Opensource version has always had in-flight healthchecks that work just perfect, see: https://www.youtube.com/watch?v=yQvcHy_tPjI https://www.youtube.com/watch?v=yQvcHy_tPjI
- takeda 11y ago1. He's not wrong, those are not healthchecks, essentially when connection fails (nginx immediatelly tries next server) this works well when service is stopped and host sends response that the port is closed. It fails miserable when host is actually down (which is what happens most of the time in real world). This also won't help you when the server is up and application is broken and returns errors, which is another very common scenario. 2. This test is unfair, it relies on default settings, where nginx has defaults to retry immediately and never give up. HAProxy by default has this option (option redispatch) disabled because it offers larger range of load balancing algorithms and in some cases this setting might not make sense. The point is that you can configure it to behave the same way. 3. In terms of in-flight health checks HAProxy has actual ones (in addition to the above redispatch mechanism) with observe option[1] and on-error[2] it can be programmed to for example simulate healthcheck down when application generates too many 5xx errors. [1] http://cbonte.github.io/haproxy-dconv/configuration-1.6.html#observe http://cbonte.github.io/haproxy-dconv/configuration-1.6.html... [2] http://cbonte.github.io/haproxy-dconv/configuration-1.6.html#on-error http://cbonte.github.io/haproxy-dconv/configuration-1.6.html...
- hrez 11y agoYep, serving 503 or otherwise broken app to users is not acceptable LB behavior. Nginx aficionados fail to comprehend that somehow. Which I guess shows that nginx is web server first and proxy/LB second.
- jimjag 11y agoAs a reverse proxy though, it is hardly the best, either in performance or compliance. As far as in creating an (unjustified) reputation for itself, it is superior. www.slideshare.net/bryan_call/choosing-a-proxy-server-apachecon-2014 www.slideshare.net/AllThingsOpen/battle-of-the-stacks
- Jeronimo2 11y agoJust for the information: Jim Jagielski, the director of Apache Foundation, who won't miss any opportunity to say how he hates nginx, and how bad nginx is. Well done!
- jimjag 11y agoIt's called "Battling FUD" :-)
- takeda 11y agoSince those are slides without the actual talk, any idea why HAProxy was excluded in many comparisons? It feels a bit biased.