Questions tagged [haproxy]

HAproxy is a TCP/HTTP load balancer which provides cookie-based persistence, advanced traffic regulation with surge protection, automatic failover, run-time regex-based header control, Web-based reporting, advanced logging to help trouble-shooting buggy applications and/or networks, and a few other features.

HAProxy is a TCP/HTTP load balancer which provides cookie-based persistence, advanced traffic regulation with surge protection, automatic fail over, run-time regex-based header control, Web-based reporting, advanced logging to help trouble-shooting buggy applications and/or networks, and a few other features.

2659 questions
102
votes
17 answers

HAProxy redirecting http to https (ssl)

I'm using HAProxy for load balancing and only want my site to support https. Thus, I'd like to redirect all requests on port 80 to port 443. How would I do this? Edit: We'd like to redirect to the same url on https, preserving query params. Thus,…
Jon Chu
  • 1,877
  • 2
  • 20
  • 19
101
votes
1 answer

Difference between global maxconn and server maxconn haproxy

I have a question about my haproxy config: #--------------------------------------------------------------------- # Global settings #--------------------------------------------------------------------- global log 127.0.0.1 syslog emerg …
chantheman
  • 5,256
  • 4
  • 23
  • 34
98
votes
4 answers

http keep-alive in the modern age

So according to the haproxy author, who knows a thing or two about http: Keep-alive was invented to reduce CPU usage on servers when CPUs were 100 times slower. But what is not said is that persistent connections consume a lot of memory…
Michael Neale
  • 19,248
  • 19
  • 77
  • 109
79
votes
2 answers

Validate haproxy.cfg

Is there any way to validate the HAProxy haproxy.cfg file before restarting the HAProxy service? For example: There might be a small spelling/syntax error in a larger haproxy.cfg file. I searched through several forums, but was unable to find…
Shawn
  • 2,679
  • 2
  • 15
  • 26
77
votes
3 answers

HAProxy vs. Nginx

I was looking at using HAProxy and Nginx for load balancing, and I had some questions: Should I use JUST HAProxy over Nginx for the proxy server? Is there any reason to have HAProxy and Nginx installed on the same proxy server?
Pat841
  • 2,663
  • 4
  • 17
  • 15
59
votes
10 answers

haproxy - unable to load SSL private key from PEM file

haproxy does not start anymore, it shows the error bind :443' : unable to load SSL private key from PEM file ... We did not change anything on the certificates or configuration. Since the last start we only made normal updates to the system. To…
efdev1234
  • 845
  • 1
  • 10
  • 18
50
votes
2 answers

Random "peer not authenticated" exceptions with Java SSLContextImpl$TLS10Context

I get connection failures that appear randomly when connecting to an HAProxy server using SSL. I have confirmed that these failures happen on JDK versions 1.7.0_21 and 1.7.0_25 but not with 1.7.0_04 or with 1.6.0_38. The exception is Exception in…
user2687486
  • 501
  • 4
  • 5
47
votes
5 answers

Load Balancing in Amazon EC2?

We've been fighting with HAProxy for a few days now in Amazon EC2; the experience has so far been great, but we're stuck on squeezing more performance out of the software load balancer. We're not exactly Linux networking whizzes (we're a .NET shop,…
Marc Bollinger
  • 3,109
  • 2
  • 27
  • 32
45
votes
1 answer

Difference between frontend/backend and listen in haproxy

Hopefully a simple question. I apologize if this has been covered before. I'm learning haproxy and overall seems very straightforward and simple. However I am curious what the difference is between using frontend/backend and listen config blocks?…
Al F
  • 703
  • 1
  • 6
  • 11
45
votes
4 answers

Haproxy in front of varnish or the other way round?

I can imagine two setups: Load-balance then cache +-- Cache server #1 (varnish) -- App server #1 / Load Balancer (haproxy)-+---- Cache server #2 (varnish) -- App server #2 …
MiniQuark
  • 46,633
  • 36
  • 147
  • 183
44
votes
4 answers

HAProxy + WebSocket Disconnection

I am using HAProxy to send requests, on a subdomain, to a node.js app. I am unable to get WebSockets to work. So far I have only been able to get the client to establish a WebSocket connection but then there is a disconnection which follows very…
Ross
  • 14,266
  • 12
  • 60
  • 91
37
votes
2 answers

HAProxy - URL Based routing with load balancing

I am new to HAProxy and I have a question about HAProxy configuration which helps me make a key decision in taking the right approach. This will greatly help me deciding the architecture. I have 3 apps. Let's say app1, app2, app3. Each app is…
rohit369
  • 401
  • 1
  • 4
  • 4
36
votes
6 answers

Can I split a large HAProxy config file into multiple smaller files?

I'm building an haproxy config file that has multiple front and backends. It's going to be several hundred lines long and I'd rather split it up into separate files for each of the different websites that I want to loadbalance. Does HAProxy offer…
stephenmurdoch
  • 34,024
  • 29
  • 114
  • 189
35
votes
2 answers

Handling OPTIONS request in nginx

We're using HAProxy as a load balancer at the moment, and it regularly makes requests to the downstream boxes to make sure they're alive using an OPTIONS request: OPTIONS /index.html HTTP/1.0 I'm working with getting nginx set up as a reverse…
ctmiller
  • 351
  • 1
  • 4
  • 6
33
votes
5 answers

HAProxy doesn't start, can not bind UNIX socket [/run/haproxy/admin.sock]

I'm trying to start haproxy (version 1.5.8 2014/10/31) with an "empty" config file and I get: user@server:~$ sudo service haproxy start [....] Starting haproxy: haproxy[ALERT] 126/120540 (7363) : Starting frontend GLOBAL: cannot bind UNIX socket…
Balazs Varhegyi
  • 991
  • 1
  • 18
  • 37
1
2 3
99 100