Hot answers tagged

6

From official documentation of Haproxy 1.6: " The load balancing algorithm of a backend is set to roundrobin when no other algorithm, mode nor option have been set. The algorithm may only be set once for each backend." Refer this link for details : https://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4-balance


4

The trick is to set an environment flag for certain requests with the SetEnvIf directive and then instruct Apache to not log requests matching that: SetEnvIf Request_URI \.gif do-not-log-this-request SetEnvIf Remote_Addr "192\.168\.50\.11" do-not-log-this-request SetEnvIf Request_Method OPTIONS do-not-log-this-request CustomLog logs/access_log common env=!...


4

As far as I know HAproxy does not have anything similar to apache's Include & IncludeOptional directives. There is no native support for multiple configuration files other than starting HAproxy with repeated -f <config-file> command line switches. see this thread. You can script something though to merge multiple subsections into a larger file ...


3

The described behavior matches haproxy's http health checks. New sessions are created because haproxy does not keep cookies between health checks, thus your application (Laravel) considers the request the first request of a new browsing session. You could reconfigure your health check url to something that does not use sessions to avoid creating the ...


3

To answer my own question, this does not seem possible, as the traffic 'leaves' HAProxy here: TCP HTTP frontend->backend (->leaving->) frontend->backend So the context is lost and the capture cannot be preserved. Instead, as "PiBa-NL" suggested on IRC at #haproxy on Freenode yesterday: [5:29pm] PiBa-NL: kvz, ...


2

Transparent mode requires that the haproxy be the default gateway of the backend servers. Remote servers won't work.


2

From my understanding of what you're asking, you have control over all the steps of this process and want to bring up new versions of a containerized application which sit behind HAProxy without interrupting client connections to the old applications, but preventing new connections. This seems like a good use of the HAProxy disable server command. You ...


2

You could add something like the following to your config: listen stats bind ${PRIVATE_IP}:${PORT} stats enable stats uri /stats stats auth admin:admin I'm assuming the following points: You don't want to expose your stats to the public. If this is not the case, just move your stats into your existing frontend directive. Substitute ${...


2

Not sure which way most of your traffic flows, if it's client -> server, or server -> client, but if it's the later, you might be interested in using (or checking out, at least) the Linux Virtual Server (LVS) which is an advanced load balancing solution that can be used to build highly scalable and highly available network services, such as ...


2

No, this is not possible. Haproxy does not understand the FTP protocol, and therefore can't do things like re-write the FTP commands and responses that include the true IP address of the FTP server. If that's a requirement, then you'll have to find a different proxy solution.


2

You cannot add a path on the server line like that, you will want to use a redirect in your listen block above the server lines: redirect location /app if { url / } and convert your server lines to server app01 10.0.0.2:8080 check See http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#redirect for further explanation/examples, and note that ...


1

As I thought, small mistakes were in place for keepalived config file. state MASTER for 192.168.50.11 # This is the master HAProxy state BACKUP for 192.168.50.12 # This is the failover HAProxy And priority 12 for 192.168.50.11 # the higher priority goes with the master HAProxy priority 11 for 192.168.50.12


1

You have configured HAProxy to connect to 10.10.104.41 port 1038. The error message tells that it is unable to connect to this port. The reason could be one of these: The app server at that IP / Port is not started. The firewall on that server is not allowing external connections. There is no route to the IP of the app server. The app server IP / Port is ...


1

In terms of software - haproxy is good, proven solution. You have several ways how to achieve correct load balancing. IP Hash balancing Depending on your source IP, destination server will be calculated using hash of source ip. Therefore all requests from one IP will always reach the same server (unless it is down). I use this option on projects, which ...


1

If some long-lived sessions are mixed with short-lived sessions (eg: WebSocket and HTTP), it's worth considering timeout tunnel, which overrides timeout client and timeout server for tunnels, as well as timeout client-fin for half-closed connections. http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4.2-timeout%20client When timeout ...


1

Just tried @System's solution and it seems that the header name was changed from HTTP_X_FORWARDED_FOR to x-forwarded-for. Probably it's related with HAproxy version, 'cause the answer was written 5 years ago...? As an example, this is working on production: String requestIp = httpRequest.getHeader("x-forwarded-for");



Only top voted, non community-wiki answers of a minimum length are eligible