LB complex algorithms combination and anonymity issues

Detailed Description of the Problem

Shot out to the HaProxy team and maintainers, keep up the good work guys !

I am in the situation of managing a complex proxy architecture composed of multiple chained load balancers each of them implementing diffent load balancing algorithms and routing request in the final stage to a specific pool of proxies.

I am encoutering 3 different issues which neither the official nor unofficial documentations are adressing completely.

1. I want to route my requests according to its final destination regarding both the dns of the endpoint targeted or/and some part of the url path. I have not found satisfying results using the following config :

I have tried path_beg, path_end, path_sub with the following config :

        bind *:8080
        mode http
        acl admin_url path_sub admin

        use_backend srvs_app1 if admin_url

backend srvs_app1
        balance leastconn
        server host1 HOST1_IP:PORT1 check
        server host2 HOST2_IP:PORT2 check

2 I use to spoof some requests parameters using a Squid and an Elite configuration according to this article Setup High Anonymous Elite Proxy with Squid | Although, I wish not to use Elite Squid nodes as a spoofing layer in my infrastructure anymore, hence I was curious to know if such an Anonymous/Elite configuration exists on HaProxy. Any help on this point would be appriciated.

3 Some of my load balancers have to implement a Least Time type algorithms and some other need to use a combination of a Power of two random choices type algorithm with a Least Time one after the random selection of two nodes have been done. I have found 2 relevant articles refering to such a set up, one for HaProxy (Test Driving "Power of Two Random Choices" Load Balancing - HAProxy Technologies) and one for NGINX (NGINX and the "Power of Two Choices" Load-Balancing Algorithm - NGINX).

In HaProxy official documentation, I have yet not found any reference to a Least Time or any combination of Power of two random choices and Least Time algorithms : DevDocs

This 3rd point critical, I really wish you guys will provide me with a clear answer on this one !


Expected Behavior

1 Being able to route my requests to different nodes according to the request endpoint url informations (DNS, Path) with path_sub and a combination of conditions (peferably with Regular Expressions).

2 Provide my HaProxy configurations with Elite/Anonymous settings.

3 Implement Least Time algorithms alone but as well combined with Power of two random choices type algorithms ( Random Two and Least Time on the random choice resulting nodes)

The infra should look as so :

Output of haproxy -vv

HA-Proxy version 2.0.13-2ubuntu0.5 2022/03/02 -
Build options :
  TARGET  = linux-glibc
  CPU     = generic
  CC      = gcc
  CFLAGS  = -O2 -g -O2 -fdebug-prefix-map=/build/haproxy-qHmAxE/haproxy-2.0.13=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -Wno-address-of-packed-member -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-old-style-declaration -Wno-ignored-qualifiers -Wno-clobbered -Wno-missing-field-initializers -Wno-implicit-fallthrough -Wno-stringop-overflow -Wno-cast-function-type -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 -Wduplicated-cond -Wnull-dereference


Default settings :
  bufsize = 16384, maxrewrite = 1024, maxpollevents = 200

Built with multi-threading support (MAX_THREADS=64, default=3).
Built with OpenSSL version : OpenSSL 1.1.1f  31 Mar 2020
Running on OpenSSL version : OpenSSL 1.1.1f  31 Mar 2020
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports : TLSv1.0 TLSv1.1 TLSv1.2 TLSv1.3
Built with Lua version : Lua 5.3.3
Built with network namespace support.
Built with transparent proxy support using: IP_TRANSPARENT IPV6_TRANSPARENT IP_FREEBIND
Built with zlib version : 1.2.11
Running on zlib version : 1.2.11
Compression algorithms supported : identity("identity"), deflate("deflate"), raw-deflate("deflate"), gzip("gzip")
Built with PCRE2 version : 10.34 2019-11-21
PCRE2 library supports JIT : yes
Encrypted password support via crypt(3): yes
Built with the Prometheus exporter as a service

Available polling systems :
      epoll : pref=300,  test result OK
       poll : pref=200,  test result OK
     select : pref=150,  test result OK
Total: 3 (3 usable), will use epoll.

Available multiplexer protocols :
(protocols marked as <default> cannot be specified using 'proto' keyword)
              h2 : mode=HTX        side=FE|BE     mux=H2
              h2 : mode=HTTP       side=FE        mux=H2
       <default> : mode=HTX        side=FE|BE     mux=H1
       <default> : mode=TCP|HTTP   side=FE|BE     mux=PASS

Available services :

Available filters :
        [SPOE] spoe
        [COMP] compression
        [CACHE] cache
        [TRACE] trace