Can't access AdguardHome DoH over Cloudflare Tunnel

Hi,

I am trying to host a DNS over HTTPS server with Adguard Home. I have set Cloudflared that connects to Caddy that then proxies all my apps. I can access AdguardHome web UI without any problem through Cloudflare Tunnel. But for a reason I can’t find, accessing the DoH server (that is on the same subdomain and should be proxied the same way) results in a “Bad Request” error.

I have set up Caddy (with Cloudflare DNS addon) this way:

adguard.example.com {
        reverse_proxy adguardhome:443 {
                transport http {
                        tls_insecure_skip_verify
                }
        }

        }

AdguardHome correctly listens on port 443 for both the web ui and DoH over adguard.example.com/dns-query/.

In Cloudflare Tunnel, I have simply set the public domain adguard.example.com redirecting to https://caddy:443 on the local machine, with TLS Origin Server name set as adguard.example.com for automatic certificates.

My problem seems very similar to this thread:

What could cause this issue with Cloudflare and DoH hosting ? Would there be a filter somewhere ?

Thanks in advance for any answer and have a great day.