summary refs log tree commit diff
path: root/host/Spacebar-nginx
diff options
context:
space:
mode:
Diffstat (limited to 'host/Spacebar-nginx')
-rwxr-xr-xhost/Spacebar-nginx/configuration.nix3
-rw-r--r--host/Spacebar-nginx/hosts/spacebar.local/secrets.nix17
2 files changed, 20 insertions, 0 deletions
diff --git a/host/Spacebar-nginx/configuration.nix b/host/Spacebar-nginx/configuration.nix
index 21da3b4..b54a392 100755
--- a/host/Spacebar-nginx/configuration.nix
+++ b/host/Spacebar-nginx/configuration.nix
@@ -26,6 +26,9 @@
       recommendedTlsSettings = true;
       virtualHosts = {
         "mail.spacebar.chat" = import ./hosts/spacebar.chat/mail.nix;
+
+        #local only
+        "secrets.spacebar.local" = import ./hosts/spacebar.local/secrets.nix { inherit lib config; };
       };
     };
   };
diff --git a/host/Spacebar-nginx/hosts/spacebar.local/secrets.nix b/host/Spacebar-nginx/hosts/spacebar.local/secrets.nix
new file mode 100644
index 0000000..d52d481
--- /dev/null
+++ b/host/Spacebar-nginx/hosts/spacebar.local/secrets.nix
@@ -0,0 +1,17 @@
+{ lib, config }: {
+  root = "/data/nginx/secrets";
+  #use ip from ens18
+  listenAddresses = [ 
+    (lib.head config.networking.interfaces.ens18.ipv4.addresses).address
+   ];
+  locations = {
+    "/" = {
+      extraConfig =
+        "autoindex on;" + 
+        "allow 192.168.1.0/24;" +
+        "allow 127.0.0.1;" +
+        "deny all;"
+        ;
+    };
+  };
+}