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

2
votes
3answers
2k views

HAProxy/Keepalived vrrp set up in AWS EC2 with EIP (Basic EC2)

I am a newbie to CentOS/Linux/HAProxy/Keepalived, so I have had a lot to learn over the past few days! I have 2 CentOS 6.5 servers in Amazon AWS running on their own EC2 Micro instances. I also have ...
6
votes
1answer
1k views

Haproxy: reject traffic by user agent from file

I am trying to reject connections from specific user agents (by matching a substring of the user-agent header) using an haproxy ACL with -f option to read from a file. However it is not working, it ...
1
vote
1answer
256 views

HAProxy SSL roundrobin not working when SSL terminated and forwarded

I am using the following config to terminate SSL so that I can inspect the request, do URL rewriting, ACL etc, and then forward the SSL traffic back to my backend servers. However, I am not able to ...
0
votes
1answer
83 views

How to fix simple HAProxy logging

I am running Ubuntu 14.04 and I am wondering how I can log everything that happens in HAProxy. I've been reading issues concerning logging and chroot. Everything is telling me to do write different ...
0
votes
1answer
116 views

HAProxy re-enable server when is up again

I'm trying to make sure that when a server goes up after being down (and not active any more) it will be re-enabled automatically. This is my haproxy.cfg: global log 127.0.0.1 local0 log ...
1
vote
1answer
2k views

HAProxy to terminate SSL also send SSL to backend server

I would like terminate SSL at HAProxy, do some manipulation on the header, rewrite URL and re-encrypt traffic and send to backend servers as SSL? I can't seem to find a way to do this. I can get ...
0
votes
1answer
24 views

Manage keepalive on haproxy

I'm tuning a haproxy server (version 1.5-dev22). Each url manage has today a backend with only one server (previously 2), so there no longer loadbalancing. Each backend has the option "httpclose" ...
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 ...
9
votes
3answers
14k views

HOWTO use haproxy custom 503 error document when back server sends 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 ...
0
votes
0answers
65 views

Configure a websocket server in front of HAProxy

I have a small python server script which creates a websocket connection and accepts base64 encoded IP packets (very similar to this). As of now my script decodes the IP packet and sends it out into ...
1
vote
1answer
79 views

Sometimes SSL error with haproxy

I'm trying to setup a haproxy for SSL offloading for multiple hosts. This works perfect with this config: # Example configuration for a possible web application. See the # full configuration options ...
1
vote
0answers
433 views

Exchange 2013 MAPI over HTTP Load balancing HAProxy

We have successfully managed to deploy HAProxy as a Layer-4 load balancer for all our Exchange 2013 SP1 HTTP based traffic (Autodiscover, OWA, EXP, EWS, MAPI, etc.) For various reasons, however, we ...
1
vote
1answer
250 views

Access to Proxy Protocol address within HAProxy

I am running HAProxy that is receiving layer 4 proxy protocol from an upstream source. I have a need to create a custom HTTP header with the address contained there. I can't seem to find how I can ...
1
vote
1answer
164 views

How to select different backend based on URI when using “mode tcp”

I am using haproxy version 1.6.2 I have enabled http2 using the config below which I need to use "mode tcp". But once I have switched from "mode http" to "mode tcp" I couldn't use acl path_beg to ...
1
vote
2answers
83 views

Clustered cron with one server only overlap allowed

I've setuped load balancers: lb1 (active) and lb2 (passive), Glustered web servers: web1 (active), web2 (backup), and some clustered database. Both web servers and databases are A pointed to the VIP ...
0
votes
1answer
815 views

Haproxy: SSL encrypted backend with self-signed cert

I'm working to configure HAProxy such that it will terminate the SSL so there's only one place to configure the purchased SSL cert. However, I'd prefer that the connection to the backend servers also ...
1
vote
2answers
42 views

Reverse proxies and ssl, should I use the same certificates

Currently I'm using nginx as a reverse proxy over https and everything that is proxied is itself over https. SSL termination happens at Nginx and since the traffic is over https it get encrypted again ...
2
votes
2answers
62 views

HAProxy MySQL check failes permanently and unexpected

I am running HAProxy to spred the load between 3 mysql galera nodes. Unfortunatelly HAProxy shows that node2 is permanently offline while the other nodes work perfectly fine. The config looks just ...
1
vote
1answer
92 views

Cannot bind port on haproxy

I'm trying to bind multiple certs on different ports but I'm getting the following error: [ALERT] 308/144418 (17671) : Starting frontend https_in: cannot bind socket [10.12.61.12:444] This is the ...
1
vote
0answers
67 views

Varnish - behind, in front of, or instead of load balancer(HAProxy/nginx)

I intend to run a few tiny ARM "physical cloud" servers behind a load balancer(either HAProxy or nginx itself), but i can't decide where to put Varnish in the whole mess. I can either have it on each ...
2
votes
2answers
17k views

HAproxy 503 Service Unavailable No server is available to handle this request

I'm new to this load balancing scenario and I'm being tasked to figure out how to make this load balancing works. My environment: Centos 6.4 64 Bit Webserver: Lighttpd All running in ESXI virtual ...
0
votes
1answer
141 views

haproxy fails to forward to backend server

i'm trying to configure haproxy on a red hat 7.1 machine (haproxy 1.5.4) to proxy a few nodejs instances. if i try to access on port 80 (haproxy frontend) it returns error 503 if i try to access on ...
15
votes
2answers
13k views

LVS vs HAProxy, which should I choose?

I am looking for a solution to load balancing and failover strategy, mainly for big web applications. We have many services to be balanced, such as web, MySQL, and many other HTTP or TCP based ...
4
votes
4answers
4k views

haproxy - pass original / remote ip in tcp mode

I've got haproxy set up with keepalived for load balancing and ip failover of a percona cluster, and since it works great I'd like to use the same lb / failover for another service/daemon. I've ...
1
vote
0answers
85 views

haproxy anonymous frontend, authorized backend with NTLM

Need to provide an anonymous readonly access to an svn repository AFAIK, haproxy cannot auth on backend by itself. There's a working configuration for haproxy with basic auth. How to migrate it to ...
1
vote
1answer
106 views

How to convert this from nginx to haproxy

How can I write this proxy pass example from nginx: code one: location /appDir/ { proxy_pass https://Name/appDir/; } to haproxy? additionally: the below is from haproxy site. code two: ...
2
votes
0answers
126 views

HAProxy failing at random times (backend has no server available!)

I have a CentOS 7.1 (x64) droplet configured to load balance between 2 apache/php servers. I have it working perfectly, but randomly throughout the day it reports the following: haproxy[12947]: ...
1
vote
1answer
94 views

Haproxy doesn't go to the write backend after coming back from Nginx Reverse Proxy

I am using haproxy and nginx to load balance as well as protect (through naxsi in nginx) my web servers. Haproxy is working fine but the minute I send it through nginx it defaults everything to the ...
-4
votes
1answer
43 views

Restart service on file change

I would like HAProxy on my Ubuntu 14.04 to restart each time I SCP a new HAProxy config file. What is the easiest/cleanest way to achieve this?
1
vote
2answers
133 views

HaProxy TCP Subdomains

global log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4500 user haproxy group ...
0
votes
0answers
10 views

How to block fake googlebots with haproxy? [duplicate]

We want to block all requests coming from non google ips but identify as a bot from google.
9
votes
4answers
6k views

Dead gateway detection on Windows 2008 Server

We have recently implemented HAProxy for stackoverflow.com. We decided on using TProxy to maintain the source address for clients connecting so our logs and other IIS modules which depend on the ...
2
votes
0answers
121 views

Haproxy Nginx/Naxsi to Web servers not working

I have a haproxy/nginx/naxsi setup for load balancing and security. Traffic is supposed to come into haproxy then to nginx/nasxi then finally to the web servers if they passed the WAF. We also have a ...
0
votes
1answer
130 views

AWS ELB 400 BAD_REQUEST with space at the end of a URI

We're using AWS ELB for HTTP/S load balancing, and we've run into a pretty crazy issue with the ELB. $ curl -i "http://yourdomain.com/ " HTTP/1.1 400 BAD_REQUEST Content-Length: 0 Connection: Close ...
0
votes
2answers
63 views

Selectively redirect to HTTPS using HAProxy

I have HAProxy configured with a single front end that accepts both HTTP and HTTPS connections. All backends are HTTP only. I would like to force certain paths to use HTTPS (/Login etc) so HAProxy ...
4
votes
1answer
9k views

redirect rewritten url using haproxy

Using haproxy version 1.4.24 on Ubuntu 14.04 I would like to use haproxy to rewrite and redirect urls which are no longer valid to their new equivalent. I am already using haproxy as the reverse ...
0
votes
0answers
71 views

how to set TOS of HAProxy outgoing tcp connections

I'm using HAProxy TCP mode. and want to set TOS of outgoing tcp connections for policy routing. seems lua function TNX.set_tos could to it, but i don't know how to call this function. ...
0
votes
2answers
122 views

How can I use NAT or haproxy to reroute a certain host name?

I have an infrastructure where all requests made by internal subnets have to pass through a server in the "open to the world" subnet, where my NAT instance is (I'm using AWS). I want to create a host ...
0
votes
1answer
88 views

How can I proxy API request to my docker container?

I have a docker container that is running a node.js application. From the system the container is running on I can do things like ... curl http://<IP address of my docker container>/users .... ...
1
vote
1answer
3k views

Haproxy “use_backend” match order

I have a problem with HAProxy, it's a snippet of my haproxy.cfg below, acl url_a path_beg /a acl dom_eye hdr_dom(host) -i www.mydomin.com use_backend eye1 if dom_eye use_backend eye2 if dom_eye ...
0
votes
0answers
20 views

Could dhclient be causing haproxy to stop listening?

I've noticed every 7 days HAProxy stops responding to requests correctly - it automatically makes firefox download a blank file in place of the website. Upon inspecting the server - everything seems ...
2
votes
1answer
80 views

Key management for HAProxy instances in OpsWorks

I'm trying to use client certificate verification in an OpsWorks HAProxy instance. The question I'm running into, and it's probably a noob issue, is how am I supposed to deploy my ssl private key to ...
-3
votes
1answer
1k views

How do I use haproxy to load balance 2 postfix servers?

I want to create a load balanced postfix using haproxy. Incoming connections will be received by Haproxy who will roundrobin between two postfix servers. I have configured haproxy. However I am new ...
2
votes
2answers
130 views

How is server replication implemented when setting up a reverse proxy environment?

I've been reading and having a go at setting up some different server cluster environments. I have it working correctly using various Linux distributions. The basic set-up goes as follows: ...
1
vote
0answers
26 views

HAProxy qtime meaning

According to the HAProxy documentation the metric qtime represents the average queue time over the last 1024 requests. My question is, does this metric average ALL requests, or just those that have ...
7
votes
1answer
23k 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 ...
0
votes
1answer
141 views

Already enabled x-forwarded for in haproxy, but mod_remoteip 2.2 backport still doesn't work

I'm using haproxy to forward requests to Apache 2.2 bundled with modsecurity 2.7 and OWASP_CRS. I have enabled insertion of the X-Forwarded-For header in the haproxy config: defaults: option ...
1
vote
2answers
632 views

Can HAProxy select a backend based on a lookup table?

Let's say I have items A, B, and C. I have two backend servers: server01 and server02. Item A can be handled by server01, item B and C can be handled by server02. New items and servers get added and ...
5
votes
1answer
165 views

HAProxy SSL Connection

We are using HA-Proxy version 1.5.11 2015/01/31, and from yesterday we noticed that all the request to our service over https is very slow. From the Chrome Developer Console, we can see the following ...
0
votes
0answers
35 views

HAProxy Statistics

In HAProxy Statistics, there is a line Running tasks: 1/2029; idle = 85 % What does it mean 1/2029? PS: For us, SSL connection is very slow with HAProxy SSL termination.