HA and Cloudflare Add-on: 400: bad request

Hello,

I am trying to move away from DuckDNS and Port Forwarding, and activate Cloudflare tunnel.

What I have done so fare is the following:

  • removed port forwarding rules in router
  • stopped DuckDNS add-on
  • removed HTTP configuration in configuration.yaml file

http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

  • installed and configured Cloudflare add-on

As result now I have:

  • Cloudflare tunnel is up and running

  • Home Assistant is “reachable” from “outside”, but the the loading of the home page throw a 400: bad request error (see below how SSL certificate is OK
    image

  • no error in Cloudflare log:

I suspect that DuckDNS and Cloudflare are making some confusion,… even by disabling the DuckDNS add-on it might have something shared/in common that break Cloudflare… any idea?

Check the HA log. This is typically because is not trusted as a proxy.

1 Like

BINGO!!! I did not added http config in configuraiton.yaml

 http:
   # Cloudflare setting to unlock reverse proxy
   use_x_forwarded_for: true
   trusted_proxies:
     - 172.30.33.0/24

thank you !!!

1 Like

I’m getting all the same errors. I have checked the proxy removed any duckDNS add on but I can’t get my remote access to load.

  • Cloudflare tunnel shows healthy
  • Cloudflare HA logs are all good
  • Yaml. code has been updated with the right proxy from the logs

Still getting the bad request error