Constant "No domain found in rule HostRegexp" warnings

Hi,

So I use HostRegexp rules extensively for redirecting aliases.
Simple example from my config below:

http:
  routers:
    home-assistant:
      rule: Host(`home-assistant.{{ domain }}`)
      entryPoints: [ "lan-https" ]
      service: home-assistant

    home-assistant-aliases:
      rule: HostRegexp(`(ha|haos|homeassistant)\.{{ domain | regex_escape }}`)
      entryPoints: [ "lan-https" ]
      middlewares:
        - home-assistant-alias-redirect
      service: noop@internal

  middlewares:
    home-assistant-alias-redirect:
      redirectRegex:
        regex: '{{ domain_regex }}'
        replacement: "https://home-assistant.{{ domain }}$1"
        permanent: true

  services:
    home-assistant:
      loadBalancer:
        servers:
          - url: "http://{{ home_assistant_address }}"

(ignore the jinja2 templates, my config is fed through ansible)

Everything works fine and just as I wish it does.
BUT my logs get absolutely spammed with these warnings
{"level":"warn","entryPointName":"lan-https","routerName":"home-assistant-aliases@file","time":"2025-12-10T19:58:57Z","message":"No domain found in rule HostRegexp((ha|haos|homeassistant)\\.my\\.domain), the TLS options applied for this router will depend on the SNI of each request"}

I have a lot of HostRegexp rules, so basically my logs are absolutely filled with these warnings and nothing else.

Am I doing something wrong, or will you always just be spammed with these warnings if you choose to use HostRegexp rules?

Any way to silence/filter out these warnings?

And since the warning mentions TLS, here is how my TLS is configured:

In the top level traefik config:

certificatesResolvers:
  cloudflare:
    acme:
      email: "{{ cf_email }}"
      storage: "{{ traefik_folder }}/acme.json"
      dnsChallenge:
        provider: cloudflare
        resolvers:
          - "1.1.1.1:53"
          - "1.0.0.1:53"

and in a base file config:

tls:
  options:
    default:
      minVersion: VersionTLS12
      sniStrict: true

  stores:
    default:
      defaultGeneratedCert:
        resolver: cloudflare
        domain:
          main: "{{ domain }}"
          sans:
            - "*.{{ domain }}"

You could use Host() || Host() || Host().

Or create an issue (or feature request) on Traefik Github.

Yeah I would rather not use Host() || Host() || Host(), seems just so stupid when regex is much more convenient. Especially when some of my rules are much more complex than my simple example.

I must say that it’s really weird that HostRegexp is offered as a feature, but comes with unavoidable warnings. Maybe I’m using it in some way that is not intended, but honestly my usage is as simple as it gets, not sure what it’s supposed to be used for then if not usages like this.

But well, if indeed it just comes with mandatory warnings than spam the logs like there’s no tomorrow, I will indeed make a feature request on GitHub to silence this warning. (Is there any way to silence any other warnings in this program? If not, I don’t imagine this would be implemented and I would have to propose something else)

You can set log level to ERROR (doc).

Sure, though that is of course not a solution since I’ll miss out on all other warnings that may be relevant.

Traefik is open source, so you could change the log level of "No domain found…" to INFO or DEBUG and compile and run it.