Reverse Proxy via NPM with Home Assistant OS in VM (KVM / libvirt)

Hello people.

I know, there are many topics of this kind, but I tried so many things, but nothing seems to work and I really don’t get why, so I am hoping, that you can help.
All this happens on my LAN.
I have a domain, that I use to setup HTTPS on my LAN. This works well with different apps, but Home Assistant refuses to work.

My setup look like this.

  • Home Assistant OS in a VM via KVM (libvirt) on Debian host
  • host system has a bridged interface
  • host system IP: x.x.x.20
  • HAOS IP: x.x.x.2
  • Nginx Proxy Manger (NPM) on another Server via Docker, also Debian host
  • IP of NPM: x.x.x.5
  • Websocket Support is active
  • SSL is active and works for other services (with same Wildcard Certificate)

I have edited /mnt/data/supervisor/homeassistant/configuration.yaml to set following directives:

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - x.x.x.5
    - x.x.x.0/24
    - 172.30.32.0/23
    - 172.30.232.0/23

If I use x.x.x.2:8123 everything works fine.
If I use the domain, It does’t.
When I check the network analysis in Firefox I see NS_ERROR_ CONNECTION_REFUSED.

In some topics I have read, that you should also allow the docker IPs for Addons to work, so I checked the interfaces inside the VM and allowed the networks of the hassio and docker0 Interfaces as well.

If I make a nslookup inside the VM I get the correct IP x.x.x.2.
It’s the same, if I make a nslookup on the host of NPM. I get x.x.x.2 there as well.

It looks like It’s a Home Assistant configuration problem for me, because of the connection refused error I mentioned above.

I hope somebody has an idea, because it’s getting pretty frustrating.
Of course I will provide further details if needed.

Thanks for your help.

Stupid me.
Don’t know, why I didn’t realize earlier, but it was a DNS problem. I even wrote it here:

nslookup has to show the IP of the proxy, not the IP of Home Assistant.