Please help. I have scoured the blogs for anything that might help and tried everything I can understand to try and I still end up with the same problem. 400: Bad Request everytime I try to access my Home Assitant from my domain. I am using AdGuard for DNS and DHCP, NGINX Proxy Manager for proxy, Let’s Encrypt for the certificarte, and cloudflare for my host. I have added in to my configuration.yaml:
and nothing seems to work. I am at my rope’s end. I don’t know what logs I should post here to help show what’s going on so any direction would be helpful. I know I’m not the only one who has faced this issue and it seems that for most everyone adding in the above has solved the problem. I am using a RPi 4 8GB with a 500 GB SSD connected to my TP-Link router with the appropriate ports open. I have followed all the instructions and everything was working perfetly until the need to add the trusted_proxies section to configuration.yaml. Thank you for your time.
Here is a copy of the log entry when I tried to access form the outside:
2021-09-25 19:25:54 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 172.70.98.43
2021-09-25 19:25:54 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 172.70.98.135
2021-09-25 19:25:55 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 172.69.35.164
As you can see they are all from different IP Addresses and one from another subnet.
Here’s another one a little later:
2021-09-25 19:42:09 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 108.162.215.105
2021-09-25 19:42:09 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 172.69.35.164
2021-09-25 19:42:11 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 108.162.215.105
2021-09-25 19:42:11 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 172.69.35.164
2021-09-25 19:42:11 ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 172.70.98.43
So, yeah. No one else has run across this before from my research. I hope this means something to someone because I’m stumped.
Hi guys after weeks of f***ing around. In your Nginx proxy server add the following to clear the X-Forwarded-For information passed on by Cloudflare:
proxy_set_header X-Forwarded-For “”;