OPNsense Forum

Archive => 17.7 Legacy Series => Topic started by: netbja on January 17, 2018, 11:04:24 pm

Title: [SOLVED] Re: haproxy and healthcheck where is IF condition ?
Post by: netbja on January 17, 2018, 11:04:24 pm
Hi all,

Just to clarify or understand this haproxy (2.2) implementation.
I have just created an OPNsense cluster for my customer with haproxy plugin for load balancing Exchange 2016 servers.

Here is an partial output from /usr/local/etc/haproxy.conf file.

Code: [Select]
# Backend: bk_exchange_owa (Exchange Backend OWA)
backend bk_exchange_owa
    # health check: hc_owa
    option httpchk GET /owa/HealthCheck.htm
    http-check expect status 200\ OK

As you can see, I have #health check: hc_owa commented but no trace in the haproxy.conf with acl or use_backend :

We should have this lines in haproxy.conf.
Code: [Select]
acl path_owa path_beg -i /owa/and
Code: [Select]
use_backend bk_exchange_owa if path_owa
Is it a bug ?

Thank you for your help.
 
Title: Re: haproxy and healthcheck where is IF condition ?
Post by: fraenki on January 18, 2018, 06:25:43 pm
As you can see, I have #health check: hc_owa commented but no trace in the haproxy.conf with acl or use_backend :

You're confusing health checks with ACLs. A health check does not involve an if-clause.

We should have this lines in haproxy.conf.
Code: [Select]
acl path_owa path_beg -i /owa/and
Code: [Select]
use_backend bk_exchange_owa if path_owa

You need to create a ACL for this. In our HAProxy plugin version 2.0 (and later) there is a two-step approach to creating a ACL:

# Go to "Rules & Checks" and create a "Condition"
# Go to "Rules & Checks" and create a "Rule" that utilizes the previously created "Condition"

Next you'll need to add this "Rule" to either your frontend ("Public Service") or backend ("Backend Pool").


Regards
- Frank
Title: Re: haproxy and healthcheck where is IF condition ?
Post by: netbja on January 19, 2018, 02:21:49 pm
Hello Franck,

You are right but did you try what you are saying ?

Sure I made Conditions and Rules  in "Rules & Checks" but the configuration file haproxy.conf does not contain any Conditions and any Rules.

So is it a bug ?

Thank you.

BJA.
Title: Re: haproxy and healthcheck where is IF condition ?
Post by: fraenki on January 19, 2018, 02:53:01 pm
You are right but did you try what you are saying ?

Yes, I'm using multiple versions of the HAProxy plugin in production.

Sure I made Conditions and Rules  in "Rules & Checks" but the configuration file haproxy.conf does not contain any Conditions and any Rules.

So is it a bug ?

Please provide screenshots of your configuration, or even better, a backup of your config.xml (only the HAProxy tag).


Regards
- Frank
Title: Re: haproxy and healthcheck where is IF condition ?
Post by: netbja on January 19, 2018, 07:13:13 pm
Hello again Frank,

In attach file, the config file config.xml

Thank you.

BJA.



Title: [SOLVED] Re: haproxy and healthcheck where is IF condition ?
Post by: netbja on January 24, 2018, 11:48:49 pm
Finaly I understand where I can put my ACL in FrontEnd, but it's a little bit more tricky than a txt file with native haproxy.

Cheers.