Hassio - Caddy - 400: Bad Request

Hi,

I am running Hassio with Caddy + Cloudflare to access remotely securely on a raspberry PI and the same PI I have OMV 6, Portainer, Jellyfin, NextCloud and Duplicati.

My domain name is already working with nextcloud and jellyfin but I am unable to setup it up for Hassio as I am getting 400: Bad Request

Caddyfile config

hassio.domainname {
reverse_proxy 192.168.1.110:8123

Configuration.yaml

server_host: 192.168.1.110:8123
  base_url: domainname
  use_x_forwarded_for: true
 
  trusted_proxies: localhost

Please advise where am I wrong? thanks in advance.

can anyone please check this one out. thanks in advance.

Topic is old but one of top results when searching for this problem.

The only trusted_proxies that worked for me was ::1 (which is essentially the IPV6 equivalent of 127.0.0.1). Also I put it in a bulleted list (not sure that matters). Like so:

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - ::1

I got that address from looking at my logs (Settings → System → Logs).

Prior to that I had also tried 127.0.0.1 as well as the local IPV4 address of the machine but neither of those worked for me. Which is weird, because I don’t use IPV6 at all. But apparently that’s what Caddy uses when proxying to localhost? [0]

HTH

[0] Just speculating, as I just started playing with Caddy this evening.