From 3ecebeabcbdfd303c23d6d945edf80cb51986a01 Mon Sep 17 00:00:00 2001 From: geemili Date: Sun, 4 Feb 2024 14:20:09 -0700 Subject: [PATCH] fix: use serverAliases option --- samsehu/matrix-conduit.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/samsehu/matrix-conduit.nix b/samsehu/matrix-conduit.nix index 6c3d9ed..e49ad82 100644 --- a/samsehu/matrix-conduit.nix +++ b/samsehu/matrix-conduit.nix @@ -18,11 +18,14 @@ in }; # Reverse proxy with Caddy - services.caddy.virtualHosts."${homeserver-url}, ${homeserver-url}:8448".extraConfig = '' - respond /.well-known/matrix/server `{ "m.server": "${homeserver-url}" }` 200 - respond /.well-known/matrix/client `{ "m.homeserver": { "base_url": "https://${homeserver-url}" } }` 200 - reverse_proxy /_matrix/* localhost:${toString config.services.matrix-conduit.settings.global.port} - ''; + services.caddy.virtualHosts."${homeserver-url}" = { + serverAliases = [ "${homeserver-url}:8448" ]; + extraConfig = '' + respond /.well-known/matrix/server `{ "m.server": "${homeserver-url}" }` 200 + respond /.well-known/matrix/client `{ "m.homeserver": { "base_url": "https://${homeserver-url}" } }` 200 + reverse_proxy /_matrix/* localhost:${toString config.services.matrix-conduit.settings.global.port} + ''; + }; # Open ports in the firewall. networking.firewall.allowedTCPPorts = [ 80 443 8448 ];