Home assistant (400 Bad Request) Docker + Proxy - Solution

@francisp, Are you talking about either of these?

  • I have set up the reverse proxy on my Synology
  • I have set up the HTTP x_forward/trusted proxy statements in HA configurations.yaml, (clearing the 400 error).

Then, yes. If there’s something other than these to enable the websockets in nginx configuration, can you provide more detail or a link? Thanks for responding!

1 Like

If you’re running it on Synology and are using the Application Portal reverse proxy, here what you need to configure:

Screenshot 2019-12-23 at 19 28 19

Control Panel > Applications Portal > Edit > Custom Headers

see:

5 Likes

Holy cow, @francisp!!! Thank you!!! I’m sorry that it was something I hadn’t found previously myself, but very thankful for your reference to it! That was simple, and it instantly started working!!! I love this HA community!

Well, my excitement was short lived… strangely, this fixed the PC/browser connection using HTTPS perfectly… it seems to work through and through. But when I try to connect with the iOS app on my phone, it stalls out when it tries to connect, and then the picture below. (This is out of the HA iOS app, not out of my phone config… it is found when I go to my profile in the app, after failure to connect.)

I’m going to move this to the other thread now, where @francisp referenced. Answer here if you know the answer, I suppose, but that seems the more appropriate place now.

Thanks!

EDIT: Well, unfortunately the referenced thread was closed. I’ll be looking for another similar. Shoot… so close!

Thank you! This worked for me.

1 Like

Works for me. Thank you!!!

1 Like

I had the problem after an update
your solution is perfect !
Thank you!!!

1 Like

Thanks. Work for my nginx reverse proxy!

1 Like

Thanks a lot ! The nginx proxy documentation should be improved with your text.

You saved my evening.

(homeassistant os version 2021.10.02)

1 Like

Also a big thanks for me. It solved the issue. Using Home assistent core-2021.10.4.

1 Like

You guys have no idea the amount of time I’ve spent trying to figure this out. This is exactly what I needed. I was checking the logs in the NPM addon, but it wasn’t very clear. I thought I might get a clue with developer tools in Chrome. Nothing helped until I read this post. Thank you @kiwijunglist for posting this. You have probably helped save my marriage LOL through this.

1 Like

I can relate to that

Thank you! This helped a great deal!

1 Like

Enable TLS 1.2?

f*ck yes… 3 days of trying to resolve this, having the similar configuration with Synology reverse proxy…
Finally working.

1 Like

This breaking change may of lead to a few divorces/breakups.

1 Like

Thank you!!!

1 Like

Awesome post. I’ve spent days trying to figure out why Home Assistant was the only service that didn’t work with my new traefik reverse proxy…

Thanks!

2 Likes

Would you be able to help explain how to implement this solution?

Very much appreciated!

1 Like

Here is an unusual case that might come up for a few. I set up an HA box in my home network. THen moved it to another network where I use an openvpn tunnel to access it, but the reverse proxy is still on my network. So guess what…what HA thinks is the reverse proxy is actually is the IP of the other end of the tunnel. I guess that’s not surprising but I had to go to the logs like the OP to see the IP and then quickly realized it was the tunnel IP. THere you have it!