summaryrefslogtreecommitdiff
path: root/nixos/sites/catbus-web-ui.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/sites/catbus-web-ui.nix')
-rw-r--r--nixos/sites/catbus-web-ui.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/nixos/sites/catbus-web-ui.nix b/nixos/sites/catbus-web-ui.nix
new file mode 100644
index 0000000..c68cdcf
--- /dev/null
+++ b/nixos/sites/catbus-web-ui.nix
@@ -0,0 +1,18 @@
+{ pkgs }:
+
+{ mosquittoHost, mosquittoPort }: {
+ locations = {
+ "/" = {
+ root = "${pkgs.eth.catbus-web-ui}";
+ };
+
+ "/mqtt" = {
+ proxyPass = "http://${mosquittoHost}:${toString mosquittoPort}";
+ proxyWebsockets = true;
+ extraConfig = ''
+ rewrite ^/mqtt$ / break;
+ rewrite ^/mqtt(.*)$ $1 break;
+ '';
+ };
+ };
+}