Comments on How to setup HAProxy as Load Balancer for Nginx on CentOS 7
HAProxy or High Availability Proxy is an open source TCP and HTTP load balancer and proxy server software. In this tutorial, I will guide you trough the HAProxy installation and configuration for 3 servers, one load balancer, and two Nginx web servers. We will install HAProxy on a single server and then install Nginx web server on the other servers. HAProxy acts as a load balancer for the Nginx web servers.
14 Comment(s)
Comments
Seems like it didn't work.
When i was testing by browsing to the load balancer's IP: It just display nginx1 even when i pressed F5 many times.
Check your haproxy log and configuration.
On my vm centos7 - this tutorial is work perfectly..
this is simple :) thanks you so much :)
Thanks a lot dude!! It works!
HAProxy is available in the CentOS 7 repository, log in to the loadbalancer server and update the package lists:
ssh [email protected] -> 192.168.1.102
thanks!
Cooling...
Thank you very much for this helpful tutorial.
Hi, Looks good article. Can I get the same step by step procedure for SFTP load balacing with HAProxy Pl.I need this on priority.
Thanks in advance.
this is not working for me. the haproxy stats shows my servers are down and logs show no server avalible when i start haproxy.
I can only open the web app on the machine it is set on. nginx1 only opens on nginx1. I thinking it has something to do with my hosts file or host names but im not that good at linux.
Under the HAProxy balance algorithm, it should be leastconn and not lastconn for the description you have given.
The best Doc !
You made my day :)
don't forget to add =
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
Hi
Thanks for this tuto. Please i just nee one clarification
does Haproxy has to be on "mode http" or "mode tcp" in case Nginx is alrady managing SSL certificate decryption ?
I have faced some issues where sites won't display in this config you described . Only being in "mode tcp" forward the raw traffic to Nginx