From 8d797790320cb86b8dc747189083ac23362d17da Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 28 Oct 2023 03:55:59 +0530 Subject: [PATCH] setup if3 subdomain --- hosts/rico2/services/caddy.nix | 25 ++++++++++++++++++++----- hosts/rico2/services/frpc.nix | 12 ++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/hosts/rico2/services/caddy.nix b/hosts/rico2/services/caddy.nix index 31ee96d..6520d53 100644 --- a/hosts/rico2/services/caddy.nix +++ b/hosts/rico2/services/caddy.nix @@ -1,12 +1,27 @@ -{secrets, ...}: { +{ + secrets, + if3, + ... +}: { services.caddy = { enable = true; inherit (secrets.caddy_config) email; - virtualHosts."proofs.adtya.xyz" = { - extraConfig = '' - redir https://keyoxide.org/hkp/${secrets.users.primary.pgpFingerprint} - ''; + virtualHosts = { + "proofs.adtya.xyz" = { + extraConfig = '' + redir https://keyoxide.org/hkp/${secrets.users.primary.pgpFingerprint} + ''; + }; + + "if3.adtya.xyz" = { + extraConfig = '' + root * ${if3.packages.web}/share/web + encode gzip + try_files {path} /index.html + file_server + ''; + }; }; }; } diff --git a/hosts/rico2/services/frpc.nix b/hosts/rico2/services/frpc.nix index b4c5aca..c4c019e 100644 --- a/hosts/rico2/services/frpc.nix +++ b/hosts/rico2/services/frpc.nix @@ -57,6 +57,18 @@ in { custom_domains = "proofs.adtya.xyz"; local_port = 443; }; + + "http.if3.adtya.xyz" = { + type = "http"; + custom_domains = "if3.adtya.xyz"; + local_port = 80; + }; + + "https.if3.adtya.xyz" = { + type = "https"; + custom_domains = "if3.adtya.xyz"; + local_port = 443; + }; }; }; }