[GH-ISSUE #526] Errors using reverse proxy with Home Assistant #445

Closed
opened 2026-02-26 06:32:53 +03:00 by kerem · 2 comments
Owner

Originally created by @tech101us on GitHub (Jul 28, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/526

Very happy with the NGINX Proxy Manager. Really takes the leg-work out of configuring NGINX reverse proxies, and integrates with Letsencrypt to boot. Thank you JC21 for developing this and hope you're able to enjoy the coffee(s) despite world conditions.

So on to my problem...
I've no problem setting up a reverse proxy with letsencrypt certificate for an apache web server hosting some static web pages. Where I run into issues is with Home Automation Assistant. I'm running Home Assistant 0.112.4 atop Debian 10 Buster. The HA Lovelace Interface is just fine when I point my browser at the local URL (http://ip.add.ress:8123). I am prompted with the login page and then presented with the lovelace default view (http://ip.add.ress:8123/lovelace/default_view).

However, with a proxy host configured via the NGINX Proxy Manager for HA, I'm initially presented with the HA login screen. Yet once I login with my credentials, Home Assistant returns a page with the HA logo in the center of the page and the message "Unable to connect to Home Assistant.". This is obviously something I've not setup quite right in the reverse proxy, since it works fine if I go directly to the HA host URL. DNS is setup locally to point at the NGINX Proxy Manager for Home Assistant on my local network, and I also have an A record for the same for access externally. My router forwards TCP ports 80 and 443 to the NGINX Proxy Manager.

In NGINX Proxy Manager, I've setup a Proxy host that triggers on requests for my Home Assistant host name (ha.mydomain.com) and forward the request to http://ip.add.ress:8123 (the IP and port number of the Home Assistant VM). I've tried both with and without SSL (with and without a Letsencrypt certificate).

Please excuse my ignorance as this whole reverse proxy thing is fairly new to me.

Have attached an image of the Home Assistant Error Message presented when attempting to access via the proxy.

Grateful for any thoughts on this issue.

HA_Error

Originally created by @tech101us on GitHub (Jul 28, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/526 Very happy with the NGINX Proxy Manager. Really takes the leg-work out of configuring NGINX reverse proxies, and integrates with Letsencrypt to boot. Thank you JC21 for developing this and hope you're able to enjoy the coffee(s) despite world conditions. So on to my problem... I've no problem setting up a reverse proxy with letsencrypt certificate for an apache web server hosting some static web pages. Where I run into issues is with Home Automation Assistant. I'm running Home Assistant 0.112.4 atop Debian 10 Buster. The HA Lovelace Interface is just fine when I point my browser at the local URL (http://ip.add.ress:8123). I am prompted with the login page and then presented with the lovelace default view (http://ip.add.ress:8123/lovelace/default_view). However, with a proxy host configured via the NGINX Proxy Manager for HA, I'm initially presented with the HA login screen. Yet once I login with my credentials, Home Assistant returns a page with the HA logo in the center of the page and the message "Unable to connect to Home Assistant.". This is obviously something I've not setup quite right in the reverse proxy, since it works fine if I go directly to the HA host URL. DNS is setup locally to point at the NGINX Proxy Manager for Home Assistant on my local network, and I also have an A record for the same for access externally. My router forwards TCP ports 80 and 443 to the NGINX Proxy Manager. In NGINX Proxy Manager, I've setup a Proxy host that triggers on requests for my Home Assistant host name (ha.mydomain.com) and forward the request to http://ip.add.ress:8123 (the IP and port number of the Home Assistant VM). I've tried both with and without SSL (with and without a Letsencrypt certificate). Please excuse my ignorance as this whole reverse proxy thing is fairly new to me. Have attached an image of the Home Assistant Error Message presented when attempting to access via the proxy. Grateful for any thoughts on this issue. ![HA_Error](https://user-images.githubusercontent.com/68884165/88615479-a4923980-d057-11ea-8e73-6c117fb3e0b8.jpg)
kerem 2026-02-26 06:32:53 +03:00
Author
Owner

@jc21 commented on GitHub (Jul 28, 2020):

I'm willing to bet the problem is that HA doesn't know it's behind a proxy and is trying to open a WebSocket or other XHR using the address http://localhost:8123. Or is otherwise not accepting connections from the IP that NPM is hosted with.

A quick search for homeassistant reverse proxy gives me this page and I think step 9 is something you need to do, editing configuration.yaml

<!-- gh-comment-id:664754708 --> @jc21 commented on GitHub (Jul 28, 2020): I'm willing to bet the problem is that HA doesn't know it's behind a proxy and is trying to open a WebSocket or other XHR using the address `http://localhost:8123`. Or is otherwise not accepting connections from the IP that NPM is hosted with. A quick search for homeassistant reverse proxy [gives me this page](https://community.home-assistant.io/t/reverse-proxy-using-nginx/196954) and I think step 9 is something you need to do, editing `configuration.yaml`
Author
Owner

@tech101us commented on GitHub (Jul 28, 2020):

JC21, you are a lifesaver. Not sure what solved it, but I enabled WebSocket support in the NPM config for my HA host -and- I added the http: section to my HA configuration.yaml as mentioned in step 9 of the site you referenced. I'm now seeing the lovelace dashboard in all its glory using a letsencrypt certificate.

Thank you...Thank you...Thank you!!!

I'm willing to bet the problem is that HA doesn't know it's behind a proxy and is trying to open a WebSocket or other XHR using the address http://localhost:8123. Or is otherwise not accepting connections from the IP that NPM is hosted with.

A quick search for homeassistant reverse proxy gives me this page and I think step 9 is something you need to do, editing configuration.yaml

<!-- gh-comment-id:664779643 --> @tech101us commented on GitHub (Jul 28, 2020): JC21, you are a lifesaver. Not sure what solved it, but I enabled WebSocket support in the NPM config for my HA host -and- I added the http: section to my HA configuration.yaml as mentioned in step 9 of the site you referenced. I'm now seeing the lovelace dashboard in all its glory using a letsencrypt certificate. Thank you...Thank you...Thank you!!! ---- > I'm willing to bet the problem is that HA doesn't know it's behind a proxy and is trying to open a WebSocket or other XHR using the address `http://localhost:8123`. Or is otherwise not accepting connections from the IP that NPM is hosted with. > > A quick search for homeassistant reverse proxy [gives me this page](https://community.home-assistant.io/t/reverse-proxy-using-nginx/196954) and I think step 9 is something you need to do, editing `configuration.yaml`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#445
No description provided.