Hi Tim
What is best practis HAProxy?
I have multiple test of the type
http-request set-var(txn.xmail_eas) bool(1) if XMail { url_beg -i
/microsoft-server-activesync }
Do I do all the test and at the end for the frontend block
Make the http-request tarpit if { var(txn.xmail_eas || txn.xmail_xxx) -m bool }
Or should I do a
http-request tarpit if { var(txn.xmail_eas) -m bool }
for each test and exit from the frontend block from there.
Normally when I code in c/c++ I prefere only to have one return in the
procedure, but what is best way in HAProxy because I will make a lot of
unnecessary test.
Also will a http-request tarpit if { var(txn.xmail_eas ) -m bool }
Work like a return so it exit from the frontend?
Regards
Henning
-----Oprindelig meddelelse-----
Fra: Tim Düsterhus <[email protected]>
Sendt: 2. januar 2022 17:04
Til: Henning Svane <[email protected]>; Aleksandar Lazic <[email protected]>;
[email protected]
Emne: Re: SV: Troubles with AND in acl
Henning,
On 1/2/22 4:00 PM, Henning Svane wrote:
> This can be parsed
> acl XMail_EAS url_beg -i /microsoft-server-activesync && XMail but
> this will not acl XMail_EAS XMail && url_beg -i
> /microsoft-server-activesync error detected while parsing ACL
> 'XMail_EAS' : unknown fetch method 'XMail' in ACL expression 'XMail'.
HAProxy does not support logical conjunctions within an ACL definition.
You can use a variable as a workaround:
http-request set-var(txn.xmail_eas) bool(1) if XMail { url_beg -i
/microsoft-server-activesync } http-request tarpit if { var(txn.xmail_eas) -m
bool }
Best regards
Tim Düsterhus