How to Install and Configure HAProxy Load Balancer on Ubuntu 24.04

in #technology • last month

Routing traffic efficiently is as important as the compute behind it. HAProxy is a lightweight, highly configurable load balancer that can handle tens of thousands of concurrent connections.

The Setup
1 HAProxy load balancer
2 Nginx backend servers
Ubuntu 24.04 LTS
What the Tutorial Covers
Preparing the backends and restricting port 80 with UFW
Installing HAProxy (version 2.8 or newer from the Ubuntu repositories)
A production-ready config: round-robin, health checks, forwardfor, and Slowloris-friendly timeouts
Validating the config before every restart
Testing with a curl loop and the stats dashboard on port 8404
SSL/TLS termination and HTTPS redirect
Using Keepalived so HAProxy is not a single point of failure
Troubleshooting 503 errors and backends stuck in the DOWN state
Read More

Full tutorial with all commands and diagrams: https://www.fitservers.com/tutorials/howto/install-configure-haproxy-load-balancer/
haproxy-load-balancer-setup.png

Sort:  

Lo del dashboard de stats en el 8404 es un golazo, no es lo mismo andar adivinando por logs. ¿El chequeo de salud lo configuraste con la opción httpchk o lo dejaste con el TCP por defecto? Con dos backends siempre me da curiosidad cómo manejan el 503 cuando uno se cae.