Home Assistant & NGINX Proxy Manager

I am wanting to use NginX Proxy Manager to reach my HomeAssistant server.

My domain is ha.mydomain.com

Initially I am trying without any certificate.

In NGINX Proxy Manager I am using http://myip:port which resolves correctly on my network.
I have websockets support enabled.

Under advance I have tried the following:

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

I have tried both $host and myip:port

When I try browsing I get bad gateway.

curl -I http://ha.mydomain.com returns

HTTP/1.1 400 Bad Request
Server: openresty
Date: Fri, 23 May 2025 09:34:00 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 16
Connection: keep-alive

All my other reverse proxy sites (which are working) are on a 192.168.30.0 subnet but this site is on my 192.168.20.0 subnet. For testing purposes I have removed all firewall rules that blocked traversing the subnets so hosts on iether subnet can reach each other.

I do have the correct DNS entry for ha.mydomain.com

I have not tested it as I am using the service from Nabu Casa, but you need to update the Home Assistant configuration.yaml to get it working:

1 Like

Thanks @LTS_Tom for that. I forgot about the HA configuration.yaml file.

Updated

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 192.168.30.11
    - 192.168.0.0/16

And all is well.

2 Likes