Q&A highlight
Posted3 months agoActive2 months ago
Ask HN: Why put a HAProxy in front of Nginx?
load balancingreverse proxyweb architecture
Ask HN: Why put a HAProxy in front of Nginx?
No synthesized answer yet. Check the discussion below.
Discussion (2 comments)
Showing 2 comments
3 months ago
HAProxy is primarily used as a load balancer. (HA = high availability) The feature sets of it and Nginx have lots of overlap (including reverse proxy), but HAProxy does not serve pages (aside from error pages), so you will need Nginx or another real webserver somewhere.
I use HAProxy to terminate TLS and HTTP/3, route to other webservers based on subdomain, and reverse proxy/cache. I'm 100% sure Nginx can do all that, though.
2 months ago
This is old thinking from 10-20 years ago when there was no one Web server that had all the features you need. Today you probably don't need a chain of servers. Make a list of features you need and then look at the docs for the current versions of HAProxy, Varnish, Caddy, and Linkerd.