HAProxy is a open source, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites crawling under very high loads while needing persistence or Layer7 processing.

learn more… | top users | synonyms

33
votes
5answers
33k views

How can I remove balanced node from haproxy via command line?

I have haproxy running as my load-balancer and from the stats web interface that comes with haproxy, I can put a web server into maintenance mode (and bring it back out again) - which is great! ...
30
votes
5answers
16k views

Ordering: 1. nginx 2. varnish 3. haproxy 4. webserver?

I've seen people recommend combining all of these in a flow, but they seem to have lots of overlapping features so I'd like to dig in to why you might want to pass through 3 different programs before ...
22
votes
4answers
16k views

HAProxy graceful reload with zero packet loss

I'm running an HAProxy load balancing server to balance load to multiple Apache servers. I need to reload HAProxy at any given time in order to change the load balancing algorithm. This all works ...
11
votes
3answers
16k views

How to setup HAProxy with failover?

I understand that, to get failover on an HAProxy load balancing setup, you need two machines running HAproxy (and route it to several webserver instances). But in this case, say abcd.com, how do we ...
1
vote
3answers
8k views

Is it possible to make redundancy on HAProxy server?

I am going to use HAProxy as a load balancer that will balance requests on 3 application servers. But what if balancer server (HAProxy) fails at some point? I was thinking of cloning the first ...
3
votes
1answer
3k views

mod_evasive behind HAPROXY

I have a couple of Apache 2 machines behind an HAPROXY setup, I tried to setup mod_evasive on those Apache machine while also using mod_rpaf to get the real X-FORWARDED client ip. For some reason, ...
7
votes
1answer
24k views

Configure multiple SSL certificates in Haproxy

My haproxy instance serves 2 domains (mostly to avoid XSS on the main site). The rules look something like this bind :443 ssl crt /etc/ssl/haproxy.pem acl is_static hdr_end(Host) -i example.com ...
2
votes
1answer
14k views

HAProxy not passing SSL traffic in TCP mode (unknown protocol)

I've got a HAProxy LB solution setup and working correctly. All HTTP traffic on port 80 is being passed through succesfully. I'm now trying to get SSL traffic to work (in TCP mode and on just one ...
5
votes
1answer
895 views

haproxy timing connection diagram

I'm trying to understand more about the Haproxy timings. Below is a snippet of the timings from the Haproxy manual: Tq: total time to get the client request (HTTP mode only)... Tw: total ...
4
votes
1answer
1k views

How can I use environment variables in haproxy.conf

My haproxy.cfg file has one backend servers using hostnames: backend servers server myapp ${PORTAL_PORT_3000_TCP_ADDR}:${PORTAL_PORT_3000_TCP_PORT} maxconn 32 myapp is running in other docker ...
1
vote
2answers
3k views

Mysterious HAProxy request errors

I see tons of request errors on one of my frontend proxies (on the order of a few per second), but I can't figure out what's causing them. I've tried using the "show errors" command on the stats ...
8
votes
2answers
32k views

haproxy and forwarding client IP address to servers

I have a problem with HAproxy. I use HAproxy as load balancer which distribute incoming http requests to 5 web servers. normally a client request's is forwarded to web servers with loadbalancer's IP. ...
6
votes
2answers
8k views

HAProxy HTTP vs TCP

HAProxy gives you the option to set the mode to TCP or HTTP. It also allows you to set the port. So why allow me to choose between HTTP and TCP, if it's letting me choose the port too? Surely if I ...
0
votes
2answers
1k views

SSHD real-ip behind haproxy

I'm trying to setup an ssh over https connection using haproxy. I'm currently looking for a way for SSHD to get the source ip from haproxy, similar to reading X-Forwarded-For or X-Real-IP headers. ...
3
votes
1answer
3k views

Redis sentinel + HAProxy failover

I am looking to implement a HA redis implementation using Master-Slave redis servers. The web servers will connect to these through an HAProxy instance installed on each box. The situation is easy ...
2
votes
1answer
3k views

Why am I getting errors in my HAProxy content switching config?

I'm migrating some infrastructure from multiple servers hosting specific sites to a load-balancing architecture using HAProxy 1.3.15.7 on OpenBSD 4.6 macppc. Naturally, I'm starting with configuring ...
1
vote
2answers
919 views

Change backend when reaching maxconn HAProxy

I have just started using HAProxy, and I am building a real-time chat application. I wonder if it is possible to send clients to another backend when the current backend reaches its maxconn (I am ...
1
vote
1answer
135 views

How to share local IP within a cluster if server is bound to one IP?

I have a cluster with 3 nodes running in VMs on test setup. Now I want to take it to production and rented 3 dedicated root servers at Hetzner Online connected by a switch. As I found out, they do ...
18
votes
7answers
45k views

How can I use HAproxy with SSL and get X-Forwarded-For headers AND tell PHP that SSL is in use?

I have the following setup: (internet) ---> [ pfSense Box ] /-> [ Apache / PHP server ] [running HAproxy] --+--> [ Apache / PHP server ] ...
10
votes
4answers
7k views

haproxy + stunnel + keep-alive?

I'd like to put stunnel in front of haproxy 1.4 to handle HTTPS traffic. I also need stunnel to add the X-Forwarded-For header. This can be achieved by the "stunnel-4.xx-xforwarded-for.diff" patches ...
13
votes
2answers
21k views

How to divert traffic based on hostname using HAProxy?

I've had some initial success with HAProxy setting up a bunch of app servers listening on various other ports. I now have another webserver listening on one port, and i'd like to what changes to make ...
17
votes
2answers
12k views

Do HTTP reverse proxies typically enable HTTP Keep-Alive on the client side of the proxied connection and not on the server side?

HAProxy has the ability to enable HTTP keep-alive on the client side (client <-> HAProxy) but disable it on the server side (HAProxy <-> server). Some of our clients connect to our web service ...
11
votes
4answers
12k views

What are the Differences between HAProxy and Ngnix in reverse proxy mode?

What are the differences between HAProxy and Nginx when it comes to their abilities as a reverse proxy?
17
votes
8answers
31k views

Remote IP's with HAProxy

I'm testing a new web server setup which is having a couple of issues. Essentially, we have a web server, where the code uses the remote IP for some interesting things, and also some apache ...
7
votes
1answer
1k views

Will this HAProxy “restart script” work as gracefully I think it will?

I put this script together from various places. What I am hoping is that it will do the following once run: Pause all "NEW" http traffic for ports 80 and 443 - just "pause" them, don't give any ...
10
votes
1answer
12k views

HAProxy reqrep remove URI on backend request

real quick question regarding HAProxy reqrep. I am trying to rewrite/replace the request that gets sent to the backend. I have the following example domain and URIs, both sharing the same domain ...
8
votes
6answers
3k views

why no examples of horizontally scalable software load balancers balancing ssl?

I have a bunch of questions with respect to ssl, local sessions, and load balancing which seem to be interconnected, so I apologize in advance for the length of this question. I have a website which ...
13
votes
6answers
18k views

Windows replacement for HAProxy

It does not appear that there is a similar question to this already posted, so I will go ahead and ask. I am working on a project that could benefit from having two - four servers handling incoming ...
7
votes
1answer
2k views

Poor load balancer performance on rackspace and centos

I am load testing different options for load balancing, and am getting poor results from Nginx, haproxy, and varnish. I have one 4GB load balancer at Rackspace, hitting 4x1GB app servers. I'm ...
5
votes
2answers
6k views

HAProxy switch only in case of server down

Let's say I have 2 servers - SA and SB. Is it possible to configure HAProxy to work like this: All connections goes to SA -> SA goes down -> HAProxy switches all connections to SB -> until SB is not ...
4
votes
1answer
3k views

Dynamic Backends with HAProxy

I'm trying to figure out the best way to handle dynamic proxying of HTTP requests. Basically I want to take a dynamic hostname in the form of myname.cust.mydomain.com and then forward requests to an ...
4
votes
2answers
3k views

Can haproxy load-balance by referrer URL? (filtering a Slashdot scenario)

I have a poorly performing web app that will be massively scaled out to cope with the weight of the internet. Haproxy will be used to farm out the stateless web requests to many servers. However, ...
16
votes
2answers
13k views

How to Read the haproxy Stats Page

For those of you using HAProxy along with the stats papge (haproxy?stats), how do I interpret this page? There is no decent explanation. For instance: Which Session column displays the number of ...
7
votes
2answers
3k views

HAProxy SSL Farm Options

I am trying to figure out how to set up an SSL farm with haproxy and SSL reverse proxies and I am looking for some general advice: Is it possible to meet all of the following: Load balance requests ...
6
votes
2answers
10k views

HAproxy subdomain redirect

I own one domain like xyz.com and I'm trying to redirect subdomain other ip with haproxy. I use tomcat on the servers and I use haproxy to redirect incoming requests on port 80 to port 8080. Like; ...
4
votes
2answers
2k views

Prevent HAProxy from toggling back from fallback to master

We have Redis master-slave setup, and we want to fallback to the slave once the master failed. But if it has failed it should never toggle back, even if the master is online again. Is this possible?
4
votes
2answers
1k views

Haproxy Resolvers Section + Amazon ELB

I'm currently using Haproxy-1.6-dev2 in front of an amazon ELB, and I'm running into DNS resolution issues. I'm working with the dev version of haproxy because of the new resolvers feature, but haven'...
3
votes
1answer
5k views

Is it possible to configure HAProxy to choose a backend server based on a request's source IP? If so, how?

The title pretty much says it all. Basically, I want to route a request to a specific backend server based on the request's source IP. i.e., HTTP Request from 192.168.100.1 -> HAProxy -> ...
2
votes
1answer
287 views

HAProxy URL Introspection

I have an application where the URL of a request determines which server to forward the request to based on a memcache or database lookup. Currently, it is just round robin, but the state is only ...
2
votes
1answer
2k views

Stunnel too many clients

I'm trying to hook up stunnel and haproxy to forward https connections through to some backend servers. I've got haproxy setup right, and I seem to have stunnel set up right. Trouble is that when I ...
6
votes
1answer
3k views

Load balancing MySQL using HAProxy: Got an error reading communication packets?

I've set up load balancing MySQL slaves using HAProxy via a xinetd. 2 load balancers shared a virtual IP that is managed by Pacemaker: crm configure show: node SVR120-27148.localdomain node SVR255-...
5
votes
2answers
5k views

Load Balancing long running TCP connections

I'm trying to research the best way to load balance long running TCP connections for the following scenario: We have multiple servers behind a redundant set of firewalls and clients establish long ...
4
votes
3answers
1k views

Is it possible to use multiple load balancers to redirect traffic to my application servers?

I'm new to load balancing and I'm wondering if it's possible to use multiple load balancers to redirect traffic to my application servers. I don't really understand how this can be done. Shouldn't a ...
3
votes
1answer
6k views

Lot of FIN_WAIT2, CLOSE_WAIT , LAST_ACK and TIME_WAIT in Haproxy

We are running haproxy in production for around 10k+ concurrent users. But we are seeing lot of FIN_WAIT2, CLOSE_WAIT , LAST_ACK and TIME_WAIT in the netstat output. This output is on a 8G ubuntu-12....
3
votes
3answers
1k views

Rolling deploys with Tomcats behind an HAProxy instance

I have three Tomcat instances running behind an HAProxy. When I roll out changes to my web applications, I'd like to do a rolling deploy (i.e. bounce one Tomcat at a time) so users don't see any ...
2
votes
2answers
2k views

Authenticated proxies on HAProxy load balancer

I want to rotate between a few http authenticated proxies. But I am unable to plug this into the config file because the url structure is different. It works when i remove the username and pass (but ...
2
votes
1answer
227 views

HAProxy/Varnish: redirecting a percentage of traffic

I'm trying to measure separate statistics for two different versions of a web page. So I need to redirect a certain percentage of my web traffic to a different page than the one requested (i.e. 20% of ...
1
vote
1answer
5k views

haproxy and persistant connections

I am using HAproxy to load balance between more web server. Those webservers are using PHP and sessions to keep one's session open. Now, I think that when a user refreshes the page, it is sent to one ...
1
vote
1answer
2k views

How to check if Ubuntu 14.04 Kernel has TPROXY

I'm using Digital Ocean's Ubuntu 14.04 image and needs the kernel to be compiled for TPROXY. Is there a way to check whether the current kernel supports TPROXY?
1
vote
1answer
15k views

Haproxy ACL for balance on URL request

I'm usung Ubuntu with haproxy 1.4.13 version. Its load balancing two subdomains: app1.domain.com app2.domain.com now i want to be able to use ACL to send based on url request to the right ...