Questions tagged [haproxy]

HAProxy is an 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.

See also:

2099 questions
18
votes
1 answer

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 to my config to flow traffic by hostname as…
Bosky
  • 315
  • 1
  • 3
  • 7
17
votes
1 answer

HAProxy ACL multiple OR conditions

Using Haproxy 1.5.12 running on Ubuntu 12.04 I need to restrict access to my website to requests either coming from certain IPs or having a defined parameter in the request. So for example the following request should work only from authorized…
jeremyjr
  • 375
  • 2
  • 7
  • 15
17
votes
2 answers

Force HAProxy to lookup DNS for backend server

I have haproxy 1.5.8, it proxies some requests (based on the path) to a third-party we have no control over. Since the IP of backend server is resolved once at startup, it breaks if the IP change. If there a workaround for that ? In nginx it's…
Bastien974
  • 1,896
  • 12
  • 44
  • 62
17
votes
2 answers

HAProxy reload - old processes never terminated

I have HAProxy setup in TCP mode, with client/server/connect timeout of 120s. When I reload the configuration too fast, I sometime end up with multiple processes. By design, this is expected, so all established connections are drained. My issue is…
Bastien974
  • 1,896
  • 12
  • 44
  • 62
17
votes
5 answers

Installing HAProxy on CentOS 6.3?

This is a weird one. I've installed the EPEL for CentOS 6 via # rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm The tried to install HAProxy: # yum update # yum install haproxy But receive: Loaded plugins:…
Elijah Paul
  • 557
  • 1
  • 8
  • 19
17
votes
2 answers

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 down - no connections go to SA, even if it is up…
Joe
  • 333
  • 1
  • 6
  • 12
17
votes
3 answers

Is there a way to add more backend server to haproxy without restarting haproxy?

We want to be able to add more backend servers on demand. Right now I don't see a way to add more backend servers to the config file without restarting haproxy.
Jan Deinhard
  • 2,383
  • 5
  • 26
  • 33
16
votes
4 answers

haproxy: how to prepare a server maintenance without kicking app sessions?

The issue I'm using haproxy to load balance web servers. I use session persistence with additional cookies as some applications use session files and these are not synchronized between servers. I want to disable a server for maintenance, but without…
Christophe Drevet
  • 2,012
  • 2
  • 18
  • 26
16
votes
3 answers

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 split/route this traffic to 2 IP addresses instead…
mixdev
  • 383
  • 2
  • 3
  • 10
14
votes
1 answer

HAProxy: multiple frontends, same bind

Is this possible / correct to configure multiple frontends that binds to the same port on HAProxy? frontend A bind :80 bind :2000-5000 acl rule_about_A use_backend server_A if rule_about_A frontend B bind :80 acl…
JonDoe297
  • 563
  • 2
  • 8
  • 21
14
votes
6 answers

HAProxy - how to append client ip in X-Client-IP and X-Forwarded-For headers?

I have a problem with HAProxy server. I want to forward in header a client IP. I almost done it, but there is interesting case and I can't figure it out. I need to write client IP in 2 places in header, in X-CLIENT-IP and X-FORWARDED-FOR tag's. The…
KacproSo
  • 143
  • 1
  • 1
  • 5
14
votes
3 answers

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 time spent in the queues waiting for a connection…
Chris Snow
  • 325
  • 2
  • 3
  • 16
14
votes
3 answers

Logging entire POST body with HAProxy?

I'm trying to track down some problems with the way a javascript client is interacting with an application server and would like to see the entire http payload (headers, body, and everything) that is being passed back and forth. It so happens that…
Peter Groves
  • 275
  • 1
  • 2
  • 6
14
votes
2 answers

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; www.xyz.com -> 10.0.0.1 www.xyz.com/abc ->…
psce
  • 171
  • 1
  • 1
  • 3
14
votes
1 answer

Basic Weight Questions with HAProxy

Do weights assigned to servers only effect the balance within that particular backend? When implementing weights for the first time, if I give all the servers in a backend the same number, would that be the same as before when there we no…
Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448