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 ];