reverse proxy to zwavejs2mqtt container #1396
-
I am working on switching from the deprecated zwave integration in home-assistant to the Z-Wave JS integration. I use home-assistant container, and am working on setting zwavejs2mqtt as another container. I already use nginx as a reverse proxy to access my home-assistant container, and need to set up reverse proxy for the zwavejs2mqtt container as well. (Side note: my docker containers are managed through balena, which is why the reverse proxy is necessary; with balena, only port 80 is accessible, so anything that needs other ports needs a reverse proxy set up to access it - I've used this with home-assistant and other containers without a problem) I ran into some issues setting up zwavejs2mqtt, and decided to start with just getting zwavejs2mqtt up and running behind the reverse proxy. My current goal is to be able to access the configuration page. However, I am encountering a blank page with 404 errors in the console when I attempt to access it: Based on the instructions here: https://zwave-js.github.io/zwavejs2mqtt/#/usage/reverse-proxy and updated the config/app.ts file to the following:
Starting logs from the container:
docker-compose.yml (note that the home-assistant container and another container running mosquitto are usually included in my docker-compose file; I'll add those back in once I have the configuration page for zwavejs2mqtt accessible behind the reverse proxy) (Also note that the I have confirmed that /dev/ttyACM0 is correct) (Also note that I need to use docker-compose version 2.1 because that is what balena supports)
I've tried several different nginx configurations for setting up the reverse proxy, here are two of them:
This one is based on https://zwave-js.github.io/zwavejs2mqtt/#/usage/reverse-proxy
Unfortunately, when I attempt to access the configuration page for zwavejs2mqtt, I see a blank page, and on checking the console, I see 404 errors (see screenshot at the beginning of this issue) I would greatly appreciate any assistance. Any ideas what might be causing the 404 errors and how I can resolve them so I can access the configuration page? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Try to se And use this: map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
location /zwavejs2mqtt {
rewrite '^/zwavejs2mqtt(/.*)$' $1 break;
proxy_pass http://localhost:8091;
proxy_set_header X-External-Path /zwavejs2mqtt;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
} |
Beta Was this translation helpful? Give feedback.
-
Hello,
Notice the trailing slash after the port (and the location, although I don't know if this one is required). |
Beta Was this translation helpful? Give feedback.
Try to se
/zwavejs2mqtt/
in base settingsAnd use this: