fix: use serverAliases option

main
LeRoyce Pearson 2024-02-04 14:20:09 -07:00
parent 96d7fb67ae
commit 3ecebeabcb
1 changed files with 8 additions and 5 deletions

View File

@ -18,11 +18,14 @@ in
}; };
# Reverse proxy with Caddy # Reverse proxy with Caddy
services.caddy.virtualHosts."${homeserver-url}, ${homeserver-url}:8448".extraConfig = '' services.caddy.virtualHosts."${homeserver-url}" = {
serverAliases = [ "${homeserver-url}:8448" ];
extraConfig = ''
respond /.well-known/matrix/server `{ "m.server": "${homeserver-url}" }` 200 respond /.well-known/matrix/server `{ "m.server": "${homeserver-url}" }` 200
respond /.well-known/matrix/client `{ "m.homeserver": { "base_url": "https://${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} reverse_proxy /_matrix/* localhost:${toString config.services.matrix-conduit.settings.global.port}
''; '';
};
# Open ports in the firewall. # Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 80 443 8448 ]; networking.firewall.allowedTCPPorts = [ 80 443 8448 ];