"Unable to connect to Home Assistant" via nginx reverse proxy

My situation is similar: I am trying to access my local HA instance that is already accessible from outside the network using a duckdns domain using the Nginx Proxy Manager on a rented server. I am stuck with such a weird configuration because I don’t have a public ipv4 address.

I am getting the same errors that you described earlier. I found online, that setting

location / {
    proxy_pass http://homeassistant.local.hass.io:%%HA_PORT%%;
    proxy_set_header Host $host;
    proxy_redirect http:// https://;
    proxy_http_version 1.1;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
}

in Nginx is supposed to help with socket forwarding. I don’t know how to use it properly in NPM but maybe it helps you out or someone else has an idea?

Edit: this worked for me Home Assistant Community Add-on: Nginx Proxy Manager - #543 by JasonLee

6 Likes