Help creating a dynamic acl/action

Reaching out to the masterminds of HAproxy

Today i have ACL rules (repeated >100 times) like this in my frontend;

ACL
subdom1 IF ssl_fc_sni -i subdom1.domain.com
subdom2 IF ssl_fc_sni -i subdom2.domain.com
subdom3 IF ssl_fc_sni -i subdom2.domain.com

Action
subdom1 use backend bk_subdom1
subdom2 use backend bk_subdom2
subdom3 use backend bk_subdom3
default use bk_default

Can I somewhat use the subdomain name dynamically to address the backend, so instead of 100 rows I will have one single row, and just manage this by adding new backends.

Hi,

use_backend name can be dynamic:
https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#4.2-use_backend

There should be nothing preventing you from building the appropriate rule.

I have to excuse myself for beeing a n00b, but how do i sample that ssl_fc_sni in the acl to use part of it in the action? - or can i refer it directly in the Action?

  • if so - how to failover to default backend…