Nginx Proxy Manager reverse proxy not working

I’ve been trying to set up home assistant and i can connect to it with the ip 192.168.2.112:8123 or homeassistant.local:8123 but when i try using nginx proxy manager it just doesn’t want to work

this is my configuration.yaml

/# Loads default set of integrations. Do not remove.
default_config:

/# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

http:
use_x_forwarded_for: true
trusted_proxies:
- 192.168.2.109

here is my nginx proxy manager configuration

i have to use google drive links because the forum doesn’t allow new users to have pictures or something

i’ve already restarted both the NPM docker container and the home assistant VM

the ip of the HAOS vm is 192.168.2.112 and the one for nginx proxy manager is 192.168.2.109

when I use other services like vaultwarden it just works perfectly

with home assistant trough the proxy i just get

502 Bad Gateway
openresty

My guess would be it’s the websockets that are causing you grief. I don’t use Proxy Manager, but I do use an Nginx reverse proxy.

Here’s my nginx config for home assistant:

server {
    server_name homeassistant.myserver.home;
    listen 80;
    return 301 https://homeassistant.myserver.home;
}

server {
    server_name homeassistant.myserver.home;
    listen 443 ssl;
    location / {
        proxy_pass http://myserver.home:8123;
        proxy_set_header X-Forwarded-For $remote_addr;
    }
    location /api/websocket {
        proxy_pass http://myserver.home:8123;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Notice the section for location /api/websocket. That’s what I think you’re missing, though I don’t know how that’s configured in Proxy Manager.

Anyway, this setup works for plain nginx reverse proxy. Hopefully it will help.