New answers tagged

0

Starting from HAProxy 2.0 uuid() function is available. So this should do exactly what you need: unique-id-format %[uuid()] unique-id-header X-Unique-ID One advantage to using unique-id-header instead of http-request set-header, is that you can set it in defaults section.


1

You don't match for ?, because it seperates path part of uri from query string part in haproxy and haproxy already does that for you. You want to change query string, but altered path. That's why your changes ended up on the wrong side of ?. Instead use http-request set-query, like this: http-request set-query clientId=${clientId}&%[query] In case you ...


0

I also tinkered with this problem for some time. The solution from David Ackerman is working fine but it can be simplified with the use of a second General Purpose Registers (available since HAProxy 1.9+) if you only need two limits. This is my solution to limit the requests per minute and per day. acl exceeds_limit_minute sc_gpc0_rate(0) ge 50 ...


0

The question is not totally clear, but if I understood, you just need to add /css to the replace string. http-request replace-path ^/subsite/css/(.*) /css/\1 if { path_beg /subsite/css/ } For details of how PCRE works in HAProxy, see the HAProxy docs.


0

If you use path_beg -i then regex .* is not necessary. As path_beg -i already implies a url starting with certain string i.e /payment will match any url starting with /payment. Here -i indicates that matching is performed ignoring case. Below are the docs snippets extracted from HaProxy's official site found here: (page is deprecated though, because HaProxy ...


1

In the backend section, http-request replace-path ^/subsite/(.*) /\1 if { path_beg /subsite/ }


1

Natural browsing (i.e. by a person) can produce bursts of connections. For example, if you load a web page, plus the images on that page, plus CSS, plus some JavaScript, you could pretty quickly get to 10 connections in a second. It is also reasonable that a person loads a home page/landing page and then within a few seconds clicks a second page. However, ...


0

I do not believe there would be a difference between the two IMAP servers being directly accessible or via HAProxy. In both cases they form a HA solution with both servers having access to the same file system. Using HAProxy prevents you from picking the IMAP server yourself while otherwise you could choose which server to use but this does not change the ...


0

First you have to activate the logs in the settings. Services -> HAProxy -> Settings, "Logging" section. In "Remote syslog host" put /var/run/log. Save and apply. Now clog -f /var/log/haproxy.log you should give you something.


0

This can happen if caching-related headers such as Expires: are set blindly, irrespective of whether HAProxy is returning content or an error to the client. What happens if the client's cache/site data is cleared? Look at the headers being returned to the browser, e.g. using developer mode on Firefox or Chrome. If HAProxy is returning cache information for ...


0

For me restarting the server did it. Restarting the haproxy service was not enough


0

Check dontlog-normal and log-separate-errors. If you need more than those can offer I suggest looking at some logging infrastructure. HAProxy won't log rejected TCP connections. You're stuck with that, rate limit at the mqtt level and perhaps use HAProxy to load balance a cluster.


Top 50 recent answers are included