And the config is:

frontend HTTP-In
    option http-buffer-request
    bind-process 1 2


    acl publisher-x  path_reg 
^\/1\.0\/manage\/bu\/ca\?token=.*seg=.*partner=987654321.*

    use_backend web1 if publisher-x

    bind 217.65.36.201:80
    bind 217.65.36.202:80
    bind 217.65.36.203:80
    bind 217.65.36.204:80
    maxconn 10000
    timeout client-fin 10s
    default_backend in

-------------------------------------------------------------------------------------------------------------------------

backend web1
    fullconn 2000
    timeout queue 1s
    option  httpchk GET /keepalive_check
    balance    roundrobin
    option     abortonclose
    option     forwardfor
    timeout server 10s
    http-request set-header X-Forwarded-Port %[dst_port]
    http-request add-header X-Forwarded-Proto https if { ssl_fc }
    server web-1 192.168.192.168:8990  weight 100  check  inter  10s minconn 10 
maxconn 200 maxqueue 1 slowstart 120s









Haim Ari / SysOps Manager

M: 972.584563032 / T: 972.722288367



________________________________
From: Haim Ari
Sent: Sunday, July 22, 2018 2:44:11 PM
To: Aleksandar Lazic
Cc: haproxy@formilux.org
Subject: Re: Regexp


Version:

HA-Proxy version 1.8.1-1ppa1~xenial 2017/12/04


Use case:

Need to direct these path_reg to a none default backend


req:


/1.0/manage/bu/ca?token=68b6f68b6f68b6f68b6f&seg=123456789&partner=987654321&os=1&bidT=CP&count=AF%2CAX%2CAL%2CDZ%2CAS%2CAD%2CAO%2CAI%2CAQ%2CAG%2CAR%2CAM%2CAW%2CAU%2CAT%2CAZ%2CBS%2CBH%2CBD%2CBB%2CBY%2CBE%2CBZ%2CBJ%2CBM%2CBT%2CBO%2CBA%2CBW%2CBV%2CBR%2CIO%2CBN%2CBG%2CBF%2CBI%2CKH%2CCM%2CCA%2CCV%2CKY%2CCF%2CTD%2CCL%2CCN%2CCX%2CCC%2CCO%2CKM%2CCG%2CCD%2CCK%2CCR%2CCI%2CHR%2CCU%2CCY%2CCZ%2CDK%2CDJ%2CDM%2CDO%2CEC%2CEG%2CSV%2CGQ%2CER%2CEE%2CET%2CFK%2CFO%2CFJ%2CFI%2CFR%2CGF%2CPF%2CTF%2CGA%2CGM%2CGE%2CDE%2CGH%2CGI%2CGR%2CGL%2CGD%2CGP%2CGU%2CGT%2CGG%2CGN%2CGW%2CGY%2CHT%2CHM%2CVA%2CHN%2CHK%2CHU%2CIS%2CIN%2CID%2CIR%2CIQ%2CIE%2CIM%2CIL%2CIT%2CJM%2CJP%2CJE%2CJO%2CKZ%2CKE%2CKI%2CKP%2CKR%2CKW%2CKG%2CLA%2CLV%2CLB%2CLS%2CLR%2CLY%2CLI%2CLT%2CLU%2CMO%2CMK%2CMG%2CMW%2CMY%2CMV%2CML%2CMT%2CMH%2CMQ%2CMR%2CMU%2CYT%2CMX%2CFM%2CMD%2CMC%2CMN%2CMS%2CMA%2CMZ%2CMM%2CNA%2CNR%2CNP%2CNL%2CAN%2CNC%2CNZ%2CNI%2CNE%2CNG%2CNU%2CNF%2CMP%2CNO%2COM%2CPK%2CPW%2CPS%2CPA%2CPG%2CPY%2CPE%2CPH%2CPN%2CPL%2CPT%2CPR%2CQA%2CRE%


The regexp i tried and works externally :


^\/1\.0\/manage\/bu\/ca\?token=.*seg=.*partner=98765432.*


Thank you







Haim Ari / SysOps Manager

M: 972.584563032 / T: 972.722288367





________________________________
From: Aleksandar Lazic <al-hapr...@none.at>
Sent: Friday, July 20, 2018 1:03 AM
To: Haim Ari
Cc: haproxy@formilux.org
Subject: Re: Regexp

Hi.

On 18/07/2018 13:10, Haim Ari wrote:
>Hello,
>
>Trying to set backend by regexp
>
>This regexp works outside of haproxy
>
>String:
>
>/1.0/manage/bu/ca?token=68bf68bf68bf68bf68bf&segId=1212121212&partner=123456789
>
>Regexp:
>
>^\/1\.0\/manage\/bu\/ca\?token=.*.segId=.*=123456789
>
>What is the right syntax for this in haproxy ?

I would use

https://regex101.com/r/TjH7Ul/1/

^\/1\.0\/manage\/bu\/ca\?token=(.*).segId=(.*).partner=123456789

and backref \1 \2

But that's just a wild guess as the information's from you are very small.

Which version of haproxy (haproxy -vv)?
Which use case do you have?
http-request/http-response/acl/..?

Some config snipped would also help a little bit ;-).

>Thank you

Best regards

Aleks

Reply via email to