HAProxy (Load Balance) - Enable stats webpage

by
Jeremy Canfield |
Updated: November 18 2022
| HAProxy (Load Balance) articles
This assumes you have installed HAProxy.
Add the following block to /etc/haproxy/haproxy.cfg.
listen stats
bind *:8080
stats enable
stats uri /stats
Notice this prior block is listening on port 8080.
- If you have a firewall, such as iptables or firewalld, allow port 8080 in the firewall.
- If you are running on Amazon Web Services (AWS), update the Security Group associated with your EC2 instance to allow inbound connections on port 8080
The ps command can be used to determine if your system is using init or systemd. If PID 1 is init, then you will use the service command. If PID 1 is systemd, then you will use the systemctl command.
If your system is using systemd, use the systemctl command to restart HAProxy.
systemctl restart haproxy
If your system is using init, use the service command to restart HAProxy.
service haproxy restart
You should now be able to access the stats page at http://<hostname or ip address>:8080/stats.
Did you find this article helpful?
If so, consider buying me a coffee over at