0

I want my HAPROXY 1.5.18 to update a parameter in the query string (&mc=cg to &mc=cd)

I have this config :

global
    user haproxy
    group haproxy
    pidfile /var/run/haproxy.pid
    daemon

defaults
    log                 global
    mode                http
    retries             3
    balance             roundrobin
    maxconn             1000
    option              redispatch
    timeout client      10m
    timeout server      10m
    timeout queue       5s
    timeout connect     5s

    log-format [%t]\ [%ci/%ft/%b/%s]\ [%Tq/%Tw/%Tc/%Tr/%Tt]\ [%ac/%fc/%bc/%sc/%rc]\ [%sq/%bq]\ %ST\ %B\ %{+Q}r\ %hr

frontend F_4_RPA
    bind 192.168.100.200:443 ssl crt /etc/ssl/certs/app_cert.pem
    acl APP1_ACL hdr(host) -i app1.x.y
    acl APP2_ACL hdr(host) -i app2.x.y
    acl APP3_ACL hdr(host) -i app3.x.y
    use_backend B_2_APP1 if IGT_ACL
    use_backend B_2_APP2 if ADT_ACL
    use_backend B_2_APP3 if EXP_ACL


backend B_2_APP3
    reqirep ^([^\ ]*)mc=cg(.*)    \1mc=cd\2
    server app301 ...
    server app302 ...

URL example : https://app3.x.y/appse/mashup/ExposeV1/getCa?service=71cceda2-75a8-2cbf-4bc0-69e1a0a352fg&mc=cg&platform=test1

I always have an output with mc=cg instead of cd (I suppose it's never matched but why ?).

I've tested my regexp on some tester over the Net and it should work but it does not...

Any idea ? :)

Thanks

Tonio
  • 1
  • I'm sorry, did you say HAProxy 1.5.18? You know that you're 5 full versions behind the current supported version right? – GregL Jul 25 '19 at 02:33
  • Yes I know we plan to update (and maybe it will works with http-request set-query) but I need something before this update that will take weeks (holidays ...). – Tonio Jul 25 '19 at 08:15
  • And waiting for Centos 8 also ... – Tonio Jul 25 '19 at 09:03

1 Answers1

0
reqirep ^([^\ ]*)(\ .*)mc=cg(.*)    \1\2mc=cd\3

Works perfectly.

Tonio
  • 1