Hallo zusammen,
ich habe eine fhem-Instanz (debian, nicht dockerized) auf einem VPS laufen, der auch als Mail-, Web- und VPN-Server bei mir fungiert.
Fhem ist hinter einem Nginx-Reverse-Proxy mit BasicAuth geschaltet:
location /fhem {
set $my_http_upgrade "";
set $my_connection "Connection";
if ($http_upgrade = "websocket") {
set $my_http_upgrade $http_upgrade;
set $my_connection "upgrade";
}
proxy_set_header Upgrade $my_http_upgrade;
proxy_set_header Connection $my_connection;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 2073600;
proxy_buffering off;
proxy_pass http://localhost:8083/fhem;
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
Das funktioniert auch, d.h. bei aufruf der URL kommt eine BasicAuth abfrage.
Da BasicAuth ja nicht mehr so Stand der Technik ist, habe ich vor Monaten einen dockerized NginxProxyManager mit Authelia davor geschaltet, um so eine Art SingleSignOn für meine Applikationen zu haben.
Das funktioniert auch alles, inklusive Fail2Ban usw., und dennoch habe ich das hier im log:
2025.12.06 11:58:40 1: Connection refused from the non-local address 93.174.95.106:59434, as there is no working allowed instance defined for it
2025.12.06 11:58:40 1: Connection refused from the non-local address 93.174.95.106:59460, as there is no working allowed instance defined for it
2025.12.06 11:58:41 1: Connection refused from the non-local address 93.174.95.106:59574, as there is no working allowed instance defined for it
2025.12.06 11:58:41 1: Connection refused from the non-local address 93.174.95.106:59600, as there is no working allowed instance defined for it
2025.12.06 11:58:41 1: Connection refused from the non-local address 93.174.95.106:59658, as there is no working allowed instance defined for it
Ich verstehe überhaupt nicht, wie das überhaupt zu fhem durchkommt. fhem sollte nur port 8083 offen haben, warum reagiert das überhaupt auf die hier gezeigten ports?
define WEB FHEMWEB 8083 global
setuuid WEB 65.......
attr WEB JavaScripts codemirror/fhem_codemirror.js
attr WEB csrfToken none
attr WEB editConfig 1
attr WEB longpoll 1
Ich habe jetzt mal das "global" testweise entfernt & werde das Log beobachten.
Dennoch verstehe ich nicht, wieso fhem überhaupt auf die ganzen Ports lauscht.
Viele Grüße,
Heiko
Diese ports im 50.000er Bereich sind temporäre interne Verbindungen, die von FHEM benötigt werden.
Die sieht man prinzipiell in jedem FHEM, wenn man "list TYPE=FHEMWEB" eingibt:
Diese Verbindungen entstehen und verschwinden von alleine wieder.
Bei mir sieht das aktuell beispielsweise so aus:
web_longpoll
web_longpoll_192.168.123.162_59839
web_longpoll_192.168.123.162_59840
web_longpoll_192.168.123.162_59842
web_longpoll_192.168.123.162_59843
web_longpoll_192.168.123.162_59844