Can't access dashboard over TLS

I’m trying to access the ESPHome dashboard over TLS so I can flash to locally connected devices. I have ESPHome running in a container, and Nginx Proxy Manager running in a container on a separate host (I need to go through the other host for various reasons).

The dashboard loads fine, but any command I try fails. In the browser I see:

WebSocket connection to 'wss://<npm_host>:<npm_port>/logs' failed

And the logs for the esphome container show:

WARNING 403 GET /logs (<npm_host_ip>) 1.48ms

When access directly through http://<esp_host_ip>:6052/ everything is working normally.

What am I doing wrong?

403 errors normally mean forbidden, so check permissions.

Thanks. I don’t have any authentication set up on my ESPHome.

There can still be permissions in relation to proxies, like trusted_proxies in HA.
NGinX might also have permissions that needs to be adjusted.

Well, that’s my question :slight_smile:
What do I need to set for the proxy to work? Note that the dashboard is loading, it’s just websockets that aren’t working (NPM is configured to support websocket, and the logs show that it does reach ESPHome).

Have you used the relative_url in the ESPHome Builder configuration?

No, I’m not using a relative URL and I’m not using the builder. I have ESPHome running in a docker container on a separate host, and served at the root.

And what if you enable leave_front_door_open?

That’s a builder configuration - as I mentioned, I’m not using the builder.
In any case, authentication is disabled.

As far as I know there are only the ESPHome integration that gets installed in the HA core and then the ESPHome Builder.
No idea what you are talking about then.

ESPHome Builder is the name of the HA add-on. As mentioned several times, I’m running ESPHome in a container on a separate host (Getting Started with the ESPHome Command Line — ESPHome)

ESPHome command line have no dashboard.
ESPHome Device Builder have and that is the same as in HA and I think the same configuration goes for it too.

I don’t want to get into a semantic argument here, because ESPHome in itself is inconsistent with terms. The addon is running a docker container, and you can run that container independently. leave_front_door_open is an addon configuration - it applies to HA authentication. I believe relative_url is an addon configuration as well, but it doesn’t matter because I’m not using a relative URL and authentication is currently turned off.

The doc I linked to described how to run the dashboard in a docker container, and links to a command line reference that details the command line parameters to the container. Neither leave_front_door_open nor relative_url are documented in either page.

Found it!
It’s the undocumented ESPHOME_TRUSTED_DOMAINS environment variable.