Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zigbee2MQTT proxy has problems to connect to zigbee2mqtt serice running on ither IP #676

Open
jbrepogmailcom opened this issue Dec 16, 2024 · 1 comment

Comments

@jbrepogmailcom
Copy link

Description of the issue

I run Home Assistant as virtual machine. It has its own OS and runs components in dockers. Then I run zigbee2mqtt service on host computer, it means it has different IP, 10.0.0.52 and different subnet. When I start zigbee2mqtt proxy in Home assistant, it shows the template and displays only 4 devices. If I start web ui of zigbee2mqtt in separate browser tab by going to 10.0.0.52 without home assistant, it displays all devices correctly. The issues seems to be happening after recent updates of HA or HA OS, probably after 2024.12.3 and OS 14. Log is attached

Addon version

core-2024.12.3, addon 0.2.0

Platform

HassOS 14

Logs of the issue (if applicable)

2024/12/16 23:44:02 [error] 12#12: *86 connect() failed (111: Connection refused) while connecting to upstream, client: 172.30.32.2, server: _, request: "GET /api HTTP/1.1", upstream: "http://10.0.0.52:8080/api?&token=", host: "95.85.255.198:8123"
nginx: the configuration file /tmp/nginx.conf syntax is ok
nginx: configuration file /tmp/nginx.conf test is successful

configuration file /tmp/nginx.conf:

Run nginx in foreground.

daemon off;

This is run inside Docker.

user nginx;

Pid storage location.

pid /var/run/nginx.pid;

Set number of worker processes.

worker_processes 1;

Enables the use of JIT for regular expressions to speed-up their processing.

pcre_jit on;

Write error log to the add-on log.

error_log /proc/1/fd/1 error;

Max num of simultaneous connections by a worker process.

events {
worker_connections 512;
}
http {
access_log off;
client_max_body_size 4G;
default_type application/octet-stream;
keepalive_timeout 65;
sendfile off;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
resolver 127.0.0.11 ipv6=off;
server {
listen 8099 default_server;
root /dev/null;
server_name _;
location / {
allow 172.30.32.2;
deny all;
set $target "http://10.0.0.52:8080";
set $token "";
set $args $args&token=$token;
proxy_pass $target;
proxy_http_version 1.1;
proxy_ignore_client_abort off;
proxy_read_timeout 86400s;
proxy_redirect off;
proxy_send_timeout 86400s;
proxy_max_temp_file_size 0;
proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr;
}
}
}
nginx: the configuration file /tmp/nginx.conf syntax is ok
nginx: configuration file /tmp/nginx.conf test is successful

configuration file /tmp/nginx.conf:

Run nginx in foreground.

daemon off;

This is run inside Docker.

user nginx;

Pid storage location.

pid /var/run/nginx.pid;

Set number of worker processes.

worker_processes 1;

Enables the use of JIT for regular expressions to speed-up their processing.

events {
worker_connections 512;
}
http {
access_log off;
client_max_body_size 4G;
default_type application/octet-stream;
keepalive_timeout 65;
sendfile off;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
resolver 127.0.0.11 ipv6=off;
server {
listen 8099 default_server;
root /dev/null;
server_name _;
location / {
allow 172.30.32.2;
deny all;
set $target "http://10.0.0.52:8080";
set $token "";
set $args $args&token=$token;
proxy_pass $target;
proxy_http_version 1.1;
proxy_ignore_client_abort off;
proxy_read_timeout 86400s;
proxy_redirect off;
proxy_send_timeout 86400s;
proxy_max_temp_file_size 0;
proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr;
}
}
}
nginx: the configuration file /tmp/nginx.conf syntax is ok
nginx: configuration file /tmp/nginx.conf test is successful

configuration file /tmp/nginx.conf:

Run nginx in foreground.

daemon off;

This is run inside Docker.

user nginx;

Pid storage location.

pid /var/run/nginx.pid;

Set number of worker processes.

worker_processes 1;

Enables the use of JIT for regular expressions to speed-up their processing.

pcre_jit on;

Write error log to the add-on log.

error_log /proc/1/fd/1 error;

Max num of simultaneous connections by a worker process.

events {
worker_connections 512;
}
http {
access_log off;
client_max_body_size 4G;
default_type application/octet-stream;
keepalive_timeout 65;
sendfile off;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
resolver 127.0.0.11 ipv6=off;
server {
listen 8099 default_server;
root /dev/null;
server_name _;
location / {
allow 172.30.32.2;
deny all;
set $target "http://10.0.0.52:8080";
set $token "";
set $args $args&token=$token;
proxy_pass $target;
proxy_http_version 1.1;
proxy_ignore_client_abort off;
proxy_read_timeout 86400s;
proxy_redirect off;
proxy_send_timeout 86400s;
proxy_max_temp_file_size 0;
proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr;
}
}
}
nginx: the configuration file /tmp/nginx.conf syntax is ok
nginx: configuration file /tmp/nginx.conf test is successful

configuration file /tmp/nginx.conf:

Run nginx in foreground.

daemon off;

This is run inside Docker.

user nginx;

Pid storage location.

pid /var/run/nginx.pid;

Set number of worker processes.

worker_processes 1;

Enables the use of JIT for regular expressions to speed-up their processing.

pcre_jit on;

Write error log to the add-on log.

error_log /proc/1/fd/1 error;

Max num of simultaneous connections by a worker process.

events {
worker_connections 512;
}
http {
access_log off;
client_max_body_size 4G;
default_type application/octet-stream;
keepalive_timeout 65;
sendfile off;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
resolver 127.0.0.11 ipv6=off;
server {
listen 8099 default_server;
root /dev/null;
server_name _;
location / {
allow 172.30.32.2;
deny all;
set $target "http://10.0.0.52:8080";
set $token "";
set $args $args&token=$token;
proxy_pass $target;
proxy_http_version 1.1;
proxy_ignore_client_abort off;
proxy_read_timeout 86400s;
proxy_redirect off;
proxy_send_timeout 86400s;
proxy_max_temp_file_size 0;
proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr;
}
}
}
nginx: the configuration file /tmp/nginx.conf syntax is ok

configuration file /tmp/nginx.conf:

nginx: configuration file /tmp/nginx.conf test is successful

Run nginx in foreground.

daemon off;

This is run inside Docker.

user nginx;

Pid storage location.

pid /var/run/nginx.pid;

Set number of worker processes.

worker_processes 1;

Enables the use of JIT for regular expressions to speed-up their processing.

pcre_jit on;

Write error log to the add-on log.

error_log /proc/1/fd/1 error;

Max num of simultaneous connections by a worker process.

events {
worker_connections 512;
}
http {
access_log off;
client_max_body_size 4G;
default_type application/octet-stream;
keepalive_timeout 65;
sendfile off;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
resolver 127.0.0.11 ipv6=off;
server {
listen 8099 default_server;
root /dev/null;
server_name _;
location / {
allow 172.30.32.2;
deny all;
set $target "http://10.0.0.52:8080";
set $token "";
set $args $args&token=$token;
proxy_pass $target;
proxy_http_version 1.1;
proxy_ignore_client_abort off;
proxy_read_timeout 86400s;
proxy_redirect off;
proxy_send_timeout 86400s;
proxy_max_temp_file_size 0;
proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr;
}
}
}

@m0wlheld
Copy link
Contributor

m0wlheld commented Jan 5, 2025

Don‘t know nothing about zigbee2mqtt „proxy“ but why don‘t you connect HA and Z2M via MQTT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants