News for hackers. Stuff that matters.
Re:HAProxy 2.4 by pull_my_finger on Sunday May 23, 2021 @03:00AM (#27252962)
I've been long interested in HAProxy, but I can't seem to sell myself on it. When might I choose HAProxy that OpenResty[1] would not be sufficient or better?

[1]: https://openresty.org/en/

Re:HAProxy 2.4 by TimWolla on Sunday May 23, 2021 @05:22AM (#27253579)
Disclosure: Community contributor to HAProxy, I help maintain HAProxy's issue tracker.

HAProxy is virtually unusable as a file server, but really shines as a reverse proxy. One of the main reasons I almost always deploy HAProxy in tandem with (stock) nginx is the superior HTTP rewriting / configuration. See also my comment back on HAProxy 2.0: https://news.ycombinator.com/item?id=20198232

HAProxy's configuration is a procedural style configuration. The HTTP rules (e.g. adding or deleting headers) are processed in order if their condition matches. (Stock) nginx has a declarative configuration which makes it hard for me to understand which options apply when and the inheritance by nesting different blocks is sometimes very confusing. One example would be an `add_header` in a `location` completely overriding (instead of extending) an `add_header` in a `server`. So if I want to put e.g. HSTS into the server to apply to the full host and also want to add headers for different paths, then I need to duplicate the HSTS stuff.

Re:HAProxy 2.4 by rogerdonut on Sunday May 23, 2021 @03:20AM (#27253036)
IMO you would use OpenResty as a web server and HAProxy as a load balancer in front of it. HAProxy focuses on being a high-performance load balancer. OpenResty is built ontop of NGINX and many of the load balancing features in NGINX are locked behind their "Plus" product, all of which are provided by default within HAProxy. In order to take advantage of these features in OpenResty (such as active health checking and DNS service discovery) you would need to use Lua scripts where in HAProxy they are implemented in the core.
Re:HAProxy 2.4 by ignoramous on Sunday May 23, 2021 @04:06AM (#27253227)
HAProxy as a load balancer / load shedder / traffic shaper is what I've seen it used for.