Reverse proxy nodered installed from homeassistant as a plugin

Hi all :slight_smile:
I have a setup where nodered is unstalled as a plugin for homeassistant.
Recently, I configured an ssl certificate (self signed) using nginx and a reverse proxy to homeassistant, so that when navigating to https://home.mydomain.com it redirects to homeassistant.

Everything worked fine before, but now when entering to nodfered, it loads all the page and the flows and then showing a message Lost connection to server, reconnecting

Looking through the network tab of the chrome dev tools showed that:
wss://home.mydomain.com/api/hassio_ingress/SOME_TOKEN/comms finishes with a message

Error during WebSocket handshake: Unexpected response code: 404

Researching online I realized that the nginx configuration doesn’t allow the /comms to pass through for some reason.
Any idea for a way to solve that?

Thanks
Ran

1 Like

This worked for me.


    location /api/hassio_ingres {
        resolver 127.0.0.11 valid=30s;
        set $upstream_app 192.168.1.123;
        set $upstream_port 8123;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

        proxy_set_header Host $host;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }