From 9e800c988257bc481f5f46daf9b41e2011b1c5a5 Mon Sep 17 00:00:00 2001
From: willifan <willifan@proton.me>
Date: Fri, 22 Nov 2024 08:04:04 +0100
Subject: [PATCH] Changed caddy from configFile to virtualHosts

---
 hosts/Anton/caddy.nix | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/hosts/Anton/caddy.nix b/hosts/Anton/caddy.nix
index 30ded7c..349c1f7 100644
--- a/hosts/Anton/caddy.nix
+++ b/hosts/Anton/caddy.nix
@@ -3,18 +3,16 @@
 
   services.caddy = {
     enable = true;
-    configFile = pkgs.writeText "Caddyfile" ''
-https://git.huwe.mooo.com {
-    reverse_proxy localhost:3000
-}
-
-https://files.huwe.mooo.com {
-    reverse_proxy localhost:444    
-}
-
-https://cal.huwe.mooo.com {
-    reverse_proxy localhost:5232
-}
-'';
+    virtualHosts = {
+      "https://git.huwe.mooo.com" = {
+        extraConfig = "reverse_proxy localhost:3000";  
+      };
+      "https://files.huwe.mooo.com" = {
+        extraConfig = "reverse_proxy localhost:444";  
+      };
+      "https://cal.huwe.mooo.com" = {
+        extraConfig = "reverse_proxy localhost:5232";  
+      };
+    };
   };
 }