Once working file provider redirect to local service url gives 404

My traefik is running in a docker environment. I have a file provider, that redirected http/https access from a domain to a mailcow service url running on my local proxmox host. After updating traefik and mailcow it stopped working some time ago and I can't find the reason, no matter what I try. The whole setup is quite complicated with a lot of containers. Some of them crowdsec and authelia secured. Everything else works without problems and errors, so I'm hesitating to post the full lot of config files.

The file provider looks like this (changed to mymail.com for privacy reasons) :

http:
  routers:
    mailcow:
      entrypoints:
        - http
      rule: "HostRegexp(`{subdomain:[a-z]+}.mymail.com`)"
      middlewares:
        - mailcow-https-redirect
      service: mailcow-local

    mailcow-secure:
      entrypoints:
        - https
      rule: "HostRegexp(`{subdomain:[a-z]+}.mymail.com`)"
      middlewares:
        - secHeaders@file
      service: mailcow-local
      tls:
        certResolver: "mycertresolver"
        domains:
          - main: "mymail.com"
            sans:
              - "*.mymail.com"

  middlewares:
    mailcow-https-redirect:
      redirectScheme:
        scheme: https
        permanent: true

  services:
    mailcow-local:
      loadBalancer:
        servers:
          - url: "http://192.168.178.35"

In the traefik dashboard and logs there are no errors or warnings. On HTTP Routers, the rules are visible, a certificate gets successfully assigned, the middlewares forwardAuth and secHeaders are assigned and the service mailcow-local is known and has the url defined in the provider.

The service url is pingable from the docker host and from within the traefik container. If I wget it from the host and from within the traefik container I get the source of the mailcow login page, so it should be available, as far as I can see. Accessing it in my local network works, too. It is not authelia protected.

Accessing e. g. http://mail.mymail.com or https://mail.mymail.com in a browser gives me the 404 instead of redirecting me to the mailcow webui like it once did. (The https redirect works fine!) Even changing the service url to something public like http://www.google.com, doesn't work and gives me the 404.

The only thing in the traefik log for this connection attempt is:

2025-02-17T11:07:29+01:00 DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:463 > IP 31.16.10.204 is not in trusted IPs list, ignoring ProxyProtocol Headers and bypass connection entryPointName=https

And in the access log is this:

31.16.10.204 - - [17/Feb/2025:11:07:29 +0100] "GET / HTTP/2.0" 404 19 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" 130 "-" "-" 0ms
31.16.10.204 - - [17/Feb/2025:11:07:29 +0100] "GET /favicon.ico HTTP/2.0" 404 19 "https://mail.mymail.com" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" 131 "-" "-" 0ms

I really need help to solve this problem.

With Traefik v3 the regex changed (doc), which is also mentioned in the migration doc:

HeaderRegexp, HostRegexp, PathRegexp, QueryRegexp, and HostSNIRegexp matchers now uses the Go regexp syntax.

It should probably be:

rule: "HostRegexp(`[a-z]+\.mymail\.com`)"

Thank you! You are a traefik hero. :smiley: That worked, after I removed the double quotes, too.
It has to be:

rule: HostRegexp(`[a-z]+\.mymail\.com`)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.