0

I’m using now haproxy v.1.7 for redirect HTTPS requests, but I have the following problem.

I want to recognize any subdomain that comes from any user for this domain test123.com (as an example) and forwarded to the same URL In my case, I don’t know the subdomains, in order to put it in the configuration for that, is there any way to put it as a variable or something like that.

Explain the config:

...

acl subdomain_is_test req_ssl_sni -i [any subdomain that comes to him from this domain].test123.com

use_backend bknd_snipt_test if subdomain_is_test

backend bknd_snipt_test
      mode tcp
      server snipt-test [any subdomain that comes to him from this domain].test123.com:443 

Thanks

1 Answers1

0

You need to use regular expressions in your acl.

acl valid_domains hdr(host) -m reg -i ^[^\.]+\.example\.org$

See HAProxy Docs for more information.

David Hulick
  • 121
  • 8