1

I have setup nginx web server and I want to do the load balancing using haproxy server. I have done these using apache but unable to do it for nginx. Below the apache settings which are working for me and able to perform the load balancing.

frontend http-in
         acl host_abc hdr_end(host) -i xyz.example.com
         use_backend abc if host_abc
backend abc
        balance leastconn
        mode http
        timeout client          5m
        timeout server          5m
        option httpchk
        option forwardfor
        server scmauto1 xxx.xxx.xxx.xxx:80 check

The same setting I have done for nginx those are not working.

  • There should be no difference. There's nothing here that's specific to Apache. You will need to be more specific than saying "those are not working." What exactly isn't working, and what does it do instead of doing what you intended? What errors do you see? What is in the logs of both HAProxy and Nginx? – Michael - sqlbot Oct 12 '16 at 17:55
  • In haproxy stats server is not showing as up. Due to this my url us not working from haproxy. request are not coming via haproxy. – beginnertopython Oct 13 '16 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.