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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
269 views

varnish ignore haproxy session affinity cookie

I have HAproxy behind varnish and I need use session affinity based on cookies. In default configuration, varnish doesn't cache content when the cookie is present. Anyone knows, how to tell varnish ...
0 votes
1 answer
728 views

haproxy domain redirect not working

https://www.foo.bar is my main domain. I want to redirect as well everything to bar.foo. It works fine with http requests, but if I try https://bar.foo, I get a certificate error and the redirect ...
1 vote
0 answers
760 views

Diagnosing bottleneck or limit in haproxy

I have haproxy in front of a high performance web app. At high volumes ~11k req/sec, the server seems to hit a limit or bottleneck at the haproxy level, while the underlying server can handle more ...
8 votes
1 answer
15k views

HAProxy set acl with hosts from file

I'd like to migrate some 100+ sites from one server to another. Current plan is to gradually add an acl for each as they are moved to direct traffic to a new server. Here is a simplified example ...
0 votes
0 answers
2k views

HAProxy custom balancing rules based on http header

I need to set up a HAProxy to work in a following way. Let's say I have only 10 users and 10 backend servers. My goal is to stick each user to his own server based on custom http header user_id. It ...
55 votes
5 answers
26k 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 ...
2 votes
1 answer
4k views

HAProxy still return 502 after 120seconds

I have HAProxy configured that will forward my http requests to various services on internal ports. One of this service may take some minutes to elaborate an answer, but after 120s HAProxy will still ...
0 votes
1 answer
1k views

haproxy url_dec does not work with url_reg

I would like to use haproxy (1.7.5-2 2017/05/17, debian stretch stock) as a first line of defense against some possible attacks (e.g. SQL injection). The idea is that I create an acl in the frontend ...
1 vote
0 answers
165 views

How to specify multiple ECDHE named curve in HAProxy?

I was browsing SSLab's server test page and found that CloudFront accepts multiple ECDHE named curve. Then I'm wondering can I do it on my HAProxy to maximize security and compatibility. It is ...
3 votes
2 answers
20k views

HAProxy configuration for RabbitMQ

I have an API that sends messages to RabbitMQ. I have a high availability RabbitMQ cluster behind HAProxy. When I load test my API I start seeing lots of this: Recovering from a network failure... ...
2 votes
0 answers
1k views

How do I get HAProxy to not change the request URL?

I setting up HAProxy, task is very easy - redirection to two servers on port 8443. I did it. But I have one trouble when I write in browser address line my domain (xyz.domain.loc), it replace my ...
0 votes
1 answer
3k views

Haproxy two processes are created by systemd

I have just compiled the latest Haproxy. [root@proxy system]# haproxy -v HA-Proxy version 1.8.8 2018/04/19 Copyright 2000-2018 Willy Tarreau <[email protected]> My service file looks as ...
1 vote
5 answers
4k views

Retrieve external IP in PHP behind Haproxy

I am using Haproxy to enable running a websocket server and Lighttpd web server on the same machine. I want to retrieve the machines external IP address from the web application running on the ...
1 vote
1 answer
3k views

HAProxy for Redis Sentinel: want BACKUP, not DOWN

I configured an HAProxy service for my Redis Cluster installation (3 nodes with Redis Sentinel managing the master delegation) and it works good: clients are redirected only to the master node and ...
2 votes
1 answer
2k views

HAProxy use urls in server config?

Right now, my config looks like this: server node1 10.20.x.y:80 check server node2 10.20.x.y:80 check server node3 10.20.x.y:80 check What would be the best way to use URLS here instead of IPs? ...
2 votes
3 answers
6k views

haproxy redirect keep querystring

Can I configure haproxy to redirect a url ending in /video1?autoplay=1 to a different url but keeping the querystring value? e.g http://domain.com/video1?autoplay=1 needs to redirect to http://...
1 vote
0 answers
684 views

HAProxy returns 503 (80 & 443 frontends + redirections managed by virtualhosts)

I've already looked for many posts, but no one solved my problem... Let me explain the context : 3 containers on a dedicated server : [10.173.223.10] haproxy [10.173.223.11] Container_A (contains ...
2 votes
1 answer
4k views

How calculate HAProxy roundrobin weights

Suppose I have two Redis database and want to distribute 70% of requests to DB1 and the other 30% to DB2. How can i calculate the weight parameter? global maxconn 20000 log 127.0.0.1 ...
1 vote
1 answer
3k views

HAProxy health checks and changing server state

I've poured through lots of docs and Google searches but can't seem to find an answer. I'm using HAProxy with several servers that take a while to start--initial loads on my local VM are about a ...
0 votes
1 answer
789 views

503 ALB health check HAProxy

I have a HAProxy behind Amazon ALB (Application Load Balancer) http/80 health check is ok, but https/443 gives me 503, even though the site is available & ok Here's what I see in HAProxy log: 4/...
19 votes
3 answers
69k views

How do I match a wildcard host in ACL lists in HAproxy?

I have the following lines in my haproxy.conf: acl valid_domains hdr(Host) -i mysite.com images.mysite.com docs.mysite.com admin.mysite.com redirect location http://mysite.com/invalid_domain if !...
1 vote
1 answer
8k views

Haproxy ACL rule for a particular domain

In my Haproxy config I have few ACL rule set. My haproxy.config looks like, frontend incoming bind *:80 acl grow_mydomain hdr(host) grow.mydoamin.com use_backend grow_mydomain if ...
0 votes
1 answer
1k views

TCP Balancer active/standby active/passive

I have two Servers, Server A,ServerB. running as TCP socket server. I want to a active/standby or /active/passive failover. that means: 1:Server A and Server B Running, route ALL connection to ...
0 votes
0 answers
2k views

HaProxy to Tomcat over SSL

I am trying to configure HaProxy - Tomcat communication over HTTPS. That is, I need to configure SSL on both HaProxy and Tomcat. I started with Tomcat and it works fine on port 8443. I imported the ...
5 votes
1 answer
10k views

haproxy redirect custom http traffic to a custom https port

I wish to redirect my custom http port traffic to custom https port based on the port I receive traffic on I have multiple bind statements : bind 1.2.3.4:7777 bind 1.2.3.4:8888 bind 1.2.3.4:9999 ...
1 vote
1 answer
7k views

set-header for HAProxy when Content-Type" is missing from headers

I am using haproxy as a load balancer. For one of our back end services, example abc, if "Content-Type" is missing from headers, we need to add the header "Content-Type" with value as "application/...
0 votes
1 answer
585 views

Multiple domains and SSL

It appears I've been way to focused on getting the Mulit Master replicating database system running and did not look much into the web server cluster and load balancer for it and SSL certifications.. ...
6 votes
2 answers
8k views

HaProxy giving - 503 Service Unavailable

I am using below configuring for performing loadbalancing for two Tomcat servers. And I configured HAProxy to perform SSL/TLS bridging/re-encryption. #-------------------------------------------------...
1 vote
3 answers
2k views

ELB with SSL pass through to either nginx or haproxy. Which is suited to handle more certs?

So I plan on having a ELB with SSL passthrough to either servers running haproxy or nginx. I will be hosting potentially thousands of lets-encrypt certs. Is either nginx or haproxy better at ...
4 votes
1 answer
7k views

HAProxy - Add response header based on request host

I have a HAProxy set up to redirect traffic to a few internal servers. What I'm trying to do is to set some response headers, based on the request host. Unfortunately I can't get it to work. Current ...
0 votes
1 answer
2k views

Use reqrep to change the path and then choose a backend based on that path

I have a need to transform the following url (not on the client/browser, but rather between the frontend and backend): from: http://myhost.com/opt-in/<some_long_guid>.html to: http://myhost....
0 votes
1 answer
2k views

Block website scraper in Haproxy

I am using Haproxy. I want to block scrapers from my website. In the haproxy.cfg , I have created a rule. acl blockedagent hdr_sub(user-agent) -i -f /etc/haproxy/badbots.lst http-request deny if ...
1 vote
2 answers
6k views

HAProxy served 503s and I don't know why

Yesterday, for around 10 minutes, my haproxy served a lot of 503 pages (directly from errorfile 503 /etc/haproxy/errors/503.http) and I don't know why. I have no health checks to my backends, so for ...
2 votes
1 answer
3k views

Server's maxconn parameter in haproxy

I'm using HAProxy in production to balance queries to a series of server instances that can only process 1 query at a time (by our own decision). Knowing that I set the maxconn parameter in the server ...
8 votes
1 answer
10k views

explanation of haproxy stats backend limit

The relevant part of my /etc/haproxy/haproxy.cfg is: global maxconn 30000 ... defaults ... frontend frontend_for_all_sites maxconn 22000 mode http bind *:80 acl ...
2 votes
0 answers
773 views

high-availability proxy with redirection based on location / ip-range

I've been using HAProxy for quite a while but recently got this issue that I don't really know how to implement/solve. +---------------------------+ client-europe \ | HAProxy ...
1 vote
1 answer
179 views

HAProxy-Apache encrypt connection

I have haproxy_server and apache_server in different datacenters, what is the best way to have encrypt connection between them? It’s working with the certbotand with the following configuration: ...
0 votes
1 answer
6k views

Simple redirect to HAproxy backend servers

I want to configure simple redirect with HAproxy. Desired behaviour: HAProxy receives request to example.com or https://example.com and returns https webserver start page from servers list excluding ...
1 vote
1 answer
3k views

How can I make haproxy rewrite a url while retaining a variable that is the middle of the path?

I'm trying to redirect a url that looks like http://host/api/getThingByID/12345 to http://host/api/addr/12345/getThing Unfortunately, regsub() does not support capture groups. I was going to try to ...
0 votes
0 answers
1k views

How to preserve cookie in HAProxy?

We currently have a the following setup: [Client] -> [haproxy] -> [Nginx] -> [App Servers] Nginx currently sets the cookie affinity to the app servers by setting a cookie i.e: public-client....
-3 votes
1 answer
51 views

Can someone explain me what those haproxy directives mean?

I cannot find an easy answer for what "inter xs fall x rise x" directives mean.
0 votes
1 answer
532 views

haproxy with nginx for webserver hosting

I have a nginx server which is serving different webservers on port 80 and 443 which works fine if i hit directly. abc.com, zyx.com client ---->abc.com,zyx.com (on nginx) Now i am trying to do ...
0 votes
1 answer
42 views

Ubuntu: Automatically stop/start/restart dependent services

I have a small cluster of 2 x Apache/PHP servers running HAProxy, connecting to 2 x MySQL clustered servers. Sites are served from both Apache servers and DNS RR is relied upon for failover and crude ...
7 votes
3 answers
17k 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 ...
20 votes
2 answers
21k 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 ...
0 votes
1 answer
554 views

haproxy http frontend , backend

I need to use haproxy for listening to port 80 and forward the request if it matches the role for that I did this this but I don't know how I can tell to use the prober back end frontend httpfw bind ...
7 votes
1 answer
19k views

Add haproxy X-Forwarded-Host request header

I have a Haproxy instance that rewrites Host headers to internal ones using http-request set-header. http-request set-header Host internal.example However, I'd still like backends to have access to ...
0 votes
2 answers
4k views

ha-proxy smtp source ip

I have haproxy in transparent mode to load balance two mail server. I have a problem with outgoing mail messages. The receiving party see that the IP of our mail server is the ip of haproxy and not ...
1 vote
3 answers
3k views

HAProxy only working for localhost

Just set up HAProxy for the first time, as a single load balancer balancing 2 servers, each of which run Varnish and Nginx. Here's the cfg file: global #uid 99 #gid 99 ...
1 vote
2 answers
10k views

HAproxy simple reverse proxy very slow

I'm currently setting up an HAproxy machine to act as a reverse proxy for a couple of websites. As the different machines are not physically connected I'm using OpenVPN to create a VPN between the ...

1
17 18
19
20 21
43