From d7b232d7c28dcfe283629a1116a84826343de8bd Mon Sep 17 00:00:00 2001 From: Ittihadyya Date: Mon, 25 Nov 2024 15:44:48 +0200 Subject: [PATCH 1/2] move caddy to separate dir --- services/website/Caddyfile | 51 ------------------------ services/website/website-content.mod.nix | 14 ------- 2 files changed, 65 deletions(-) delete mode 100644 services/website/Caddyfile delete mode 100644 services/website/website-content.mod.nix diff --git a/services/website/Caddyfile b/services/website/Caddyfile deleted file mode 100644 index c35763c..0000000 --- a/services/website/Caddyfile +++ /dev/null @@ -1,51 +0,0 @@ -{ - layer4 { - :222 { - @a ssh - route @a { - proxy 10.24.1.9:222 - } - } - :64738 { - route { - proxy 10.24.1.4:64738 - } - } - } -} - -https://collective-conciousness.monster { - encode zstd gzip - header { - Strict-Transport-Security "max-age=31536001; includeSubdomains; preload" - } - root * /var/www/public - file_server { - precompressed zstd br gzip - } -} - -https://git.collective-conciousness.monster { - reverse_proxy 10.24.1.9:3000 -} - -https://obs.collective-conciousness.monster { - reverse_proxy 10.24.1.4:5894 -} - -https://gts.collective-conciousness.monster { - # Optional, but recommended, compress the traffic using proper protocols - encode zstd gzip - - # The actual proxy configuration to port 8080 (unless you've chosen another port number) - reverse_proxy 127.0.0.1:8080 { - # Flush immediately, to prevent buffered response to the client - flush_interval -1 - } -} - -https://cache.collective-conciousness.monster { - encode zstd gzip - - reverse_proxy 10.24.1.4:5020 -} \ No newline at end of file diff --git a/services/website/website-content.mod.nix b/services/website/website-content.mod.nix deleted file mode 100644 index 2fc5522..0000000 --- a/services/website/website-content.mod.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - aspartame.modules = [ - ( - { pkgs, lib, ... }: - { - services.caddy = { - enable = true; - package = pkgs.caddy-many; - configFile = ./Caddyfile; - }; - } - ) - ]; -} From af21cb5fc61e8395467a16ee2ca07fe206664c1c Mon Sep 17 00:00:00 2001 From: Ittihadyya Date: Mon, 25 Nov 2024 15:45:14 +0200 Subject: [PATCH 2/2] squash! move caddy to separate dir --- services/caddy/Caddyfile | 51 ++++++++++++++++++++++++++++++++++++++++ services/caddy/caddy.nix | 14 +++++++++++ 2 files changed, 65 insertions(+) create mode 100644 services/caddy/Caddyfile create mode 100644 services/caddy/caddy.nix diff --git a/services/caddy/Caddyfile b/services/caddy/Caddyfile new file mode 100644 index 0000000..c35763c --- /dev/null +++ b/services/caddy/Caddyfile @@ -0,0 +1,51 @@ +{ + layer4 { + :222 { + @a ssh + route @a { + proxy 10.24.1.9:222 + } + } + :64738 { + route { + proxy 10.24.1.4:64738 + } + } + } +} + +https://collective-conciousness.monster { + encode zstd gzip + header { + Strict-Transport-Security "max-age=31536001; includeSubdomains; preload" + } + root * /var/www/public + file_server { + precompressed zstd br gzip + } +} + +https://git.collective-conciousness.monster { + reverse_proxy 10.24.1.9:3000 +} + +https://obs.collective-conciousness.monster { + reverse_proxy 10.24.1.4:5894 +} + +https://gts.collective-conciousness.monster { + # Optional, but recommended, compress the traffic using proper protocols + encode zstd gzip + + # The actual proxy configuration to port 8080 (unless you've chosen another port number) + reverse_proxy 127.0.0.1:8080 { + # Flush immediately, to prevent buffered response to the client + flush_interval -1 + } +} + +https://cache.collective-conciousness.monster { + encode zstd gzip + + reverse_proxy 10.24.1.4:5020 +} \ No newline at end of file diff --git a/services/caddy/caddy.nix b/services/caddy/caddy.nix new file mode 100644 index 0000000..2fc5522 --- /dev/null +++ b/services/caddy/caddy.nix @@ -0,0 +1,14 @@ +{ + aspartame.modules = [ + ( + { pkgs, lib, ... }: + { + services.caddy = { + enable = true; + package = pkgs.caddy-many; + configFile = ./Caddyfile; + }; + } + ) + ]; +}