Fix matrix public_baseurl being wrong

Still forward traffic on vanpetegem.me for now, since clients don't seem to
update automatically (immediately?).
This commit is contained in:
Charlotte Van Petegem 2022-03-06 01:43:19 +01:00
parent d76b03ed7f
commit ed11652607
No known key found for this signature in database
GPG key ID: 019E764B7184435A
2 changed files with 15 additions and 2 deletions

View file

@ -69,7 +69,20 @@
}; in
{
"/_matrix" = matrixRedirect;
"/.well-known/matrix" = matrixRedirect;
"/.well-known/matrix" = {
root = pkgs.runCommandNoCC "well-known-matrix" { } ''
mkdir -p $out/.well-known/matrix
echo '{"m.server":"matrix.vanpetegem.me:443"}' > $out/.well-known/matrix/server
echo '{"m.homeserver":{"base_url":"https://matrix.vanpetegem.me"}}' > $out/.well-known/matrix/client
'';
extraConfig = ''
default_type application/json;
add_header 'access-control-allow-origin' '*' always;
add_header 'access-control-allow-methods' 'GET, HEAD, POST, PUT, DELETE, OPTIONS' always;
add_header 'access-control-allow-headers' 'X-Requested-With, Content-Type, Authorization, Date' always;
'';
priority = 1;
};
"/".return = "307 https://www.vanpetegem.me$request_uri";
};
};

View file

@ -31,7 +31,7 @@
matrix-synapse = {
enable = true;
server_name = "vanpetegem.me";
public_baseurl = "https://vanpetegem.me";
public_baseurl = "https://matrix.vanpetegem.me";
listeners = [{
port = 8448;
bind_address = "localhost";