From 893ad555ab14391ff7de29bdb2b74fa27e2e8c72 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sat, 5 Dec 2020 22:47:54 +0100 Subject: [PATCH] zigbee2mqtt : start webinterface --- configs/pepe/home-assistant/zigbee2mqtt.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/configs/pepe/home-assistant/zigbee2mqtt.nix b/configs/pepe/home-assistant/zigbee2mqtt.nix index 444f536..0b00c1b 100644 --- a/configs/pepe/home-assistant/zigbee2mqtt.nix +++ b/configs/pepe/home-assistant/zigbee2mqtt.nix @@ -54,6 +54,11 @@ in { advanced.network_key = import ; advanced.log_output = [ "console" ]; + # configure web ui + frontend.port = 9666; + frontend.host = "0.0.0.0"; + experimental.new_api = true; + }; }; @@ -61,4 +66,20 @@ in { ZIGBEE2MQTT_DATA = "/var/lib/zigbee2mqtt"; }; + services.nginx = { + enable = true; + recommendedProxySettings = true; + virtualHosts = { + "zigbee2mqtt.pepe.private" = { + serverAliases = [ "zigbee.pepe.private" ]; + locations."/" = { + proxyPass = "http://localhost:${ + toString config.services.zigbee2mqtt.config.frontend.port + }"; + proxyWebsockets = true; + }; + }; + }; + }; + }