Which part? It solves an issue where HA is being a proxy . So make sure that is your setup.
The fix has 3 steps
Check configuration->basic->log for reverse proxy error. Note the IP address in the error message. if you don’t have it, then you have a different problem.
Edit the configuration.yaml file
http:
use_x_forwarded_for: true
trusted_proxies:
- XXX.XXX.XXX.XXX # Add the IP address of the proxy server
Restart your Home Assistant server.
The problem should be resolved.
I’ve had problems with HA behind cloudflare’s proxy , and I had to turn it off for external access to the server to work. I reconfigured my proxy setup over the weekend, and HA was the last server I had to get working behind cloudflare’s proxy.
I’m done! I can enjoy the last few hours of my weekend now, lol. This thread saved those last few hours so thanks!
Thanks @kiwijunglist for this post. I had a different issue, but pointed me into the right direction to solve it.
I am running HASS Supervised on a pi behind a traefik reverseproxy in a docker on a synology NAS. This NAS has two ethernet ports.
I configured only one of them in HASS which worked for months. But suddenly I got the 400.
Adding the 2nd IP Address in the http section solved it.
Just came here to bump this thread. Went from HA Docker + SWAG Docker install to Hass OS so had to repoint DNS internally etc. It was this http: config in configration.yaml that was the issue.
Went from 1 hr of troubleshooting to 15 minutes. Thanks all!
Hello,
So far this solution worked for me.
I reconfigured my docker.
So I recreated the docker of my HA, and I reused the same file space to keep my HA.
With HA local ip it works.
On the other hand, for public access, I use a Duckdns domain name which points to my reverse Nginx proxy in a docker. My Nginx’s docker has a bridge network while my HA’s has a host.
I have good in my configuration.yaml http: use_x_forwarded_for: true trusted_proxies: - 172.18.0.2
Dans les logs de HA, j’ai 2023-01-10 10:06:05.518 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 172.18.0.2
I’m using the same configuration of my Nginx as before.
If you have different solutions.
But when I reload configuration I get:
Invalid config for [http]: not a valid value @ data[‘http’][‘trusted_proxies’][0]. Got ‘x.x.x.x/15’. (See /config/configuration.yaml, line 17).
From documentation it accepts subnets, or am I wrong somewhere?
With a fresh install it does not seem feasible to change the configuration when having only access to the system console for a HAOS installation behind a proxy. I temporaralily had to bypass the proxy to be able to change the configuration.
And further more, the system is not happy with the fact I have two proxies…:
2023-02-24 01:16:51.294 ERROR (MainThread) [homeassistant.components.http.forwarded] Too many headers for X-Forwarded-For: ['10.33.2.69', '192.168.0.254']
EDIT:
To fix this with HAPROXY (on opnsense), I disabled the “X-Forwarded-For header” option in the “Public service”:
But I then added the option explicitly in the Option passtrough by adding it only when the header is absent (optioni forwardfor if-none):