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:

2071 questions
22
votes
3 answers

How can I use a custom 503 error document when HAProxy sends a 503 HTTP code?

I would like haproxy to use its own 503 document page when back server (backend) sends HTTP 503 code. Is it possible? Have seen something like "monitor fail" conditions but don't know how to add it to the frontend.
Marcin
  • 603
  • 4
  • 8
  • 15
20
votes
2 answers

How does HTTPS certificate switching work (like on suche.org)?

For those that don't know what Suche.org is, it is a website that has a perfect A+ rating on SSL Labs in every category: (Suche.org SSL Labs result). I became aware of this website when I opened another ticket about ECC certificates not working in…
Scott Crooks
  • 430
  • 4
  • 10
20
votes
8 answers

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 directories secured down to some certain IP's (our office…
Neil Middleton
  • 412
  • 1
  • 4
  • 11
20
votes
6 answers

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 ] +--> [ Apache / PHP server ] …
Josh
  • 9,001
  • 27
  • 78
  • 124
19
votes
2 answers

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 wanted HTTP I could just choose TCP and port…
marflar
  • 367
  • 1
  • 2
  • 9
19
votes
3 answers

Serve 404 from HAProxy when no acls match

I'm currently re-configuring HAProxy using 1.5dev-17. What I'd like to do is return a 404 error when there is no backend to use for a particular request. Our current configuration uses the default_backend to route to our django app servers, but when…
Josh Smeaton
  • 1,330
  • 2
  • 19
  • 31
19
votes
3 answers

When using TCP load balancing with HAProxy, does all outbound traffic flow through the LB?

I am setting up an app to be hosted using VMs(probably amazon, but that is not set in stone) which will require both HTTP load balancing and load balancing a large number(50k or so if possible) of persistant TCP connections. The amount of data is…
user122875
  • 209
  • 1
  • 2
  • 5
18
votes
2 answers

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 domain name match one to one with a certain…
18
votes
4 answers

Haproxy not logging requests?

So, I configured Haproxy so the logging would go through rsyslog and, for now, be all dumped in one file. It's definetly logging, as I get those "starting" messages on startup, but no HTTP requests logging at all. What is wrong with my…
Silver Quettier
  • 503
  • 2
  • 6
  • 14
18
votes
4 answers

HAProxy logging to syslog

I installed HAProxy 1.5 via apt-get on ubuntu 14.04 via ppa:vbernat/haproxy-1.5 as per this Debian repository selection tool. The problem is it logging to /var/log/syslog instead of /var/log/haproxy.log The setup is basically the…
Petah
  • 650
  • 2
  • 13
  • 24
18
votes
2 answers

HA Proxy - roundrobin vs leastconn

Are there any suggestion on when should I use roundrobin & when should I use leastconn? I am using roundrobin currently and observed the loading of my back-end servesr are not evenly distribution. Of course there might be other issue, but we want to…
Ryan
  • 5,341
  • 21
  • 71
  • 87
18
votes
3 answers

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. But I need clients IPs or real IPs who request…
System
  • 507
  • 1
  • 3
  • 7
18
votes
2 answers

How can I make haproxy route requests based on URL substrings?

A load balancer is set up with two back ends. The request URI will look like the following: http://example.com/answers/submit http://example.com/tag-02/answers/submit How can I configure haproxy in such a way that the request is sent to one or the…
Autodidact
  • 385
  • 2
  • 4
  • 13
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
4 answers

Bind to all interfaces for IPv4 and IPv6 in haproxy

I want to configure haproxy to bind to a tcp as well as tcp6 socket on all interfaces (i.e., 0.0.0.0:80 and :::80). I was able to reach this goal with the following settings: listen web bind :80 v4v6 bind :::80 v6only Is there any shorter way…
StephenKing
  • 932
  • 1
  • 8
  • 18