This commit is contained in:
Jana Dönszelmann 2025-08-03 16:20:26 +02:00
parent b27835f9b7
commit 552eceaf18
No known key found for this signature in database
3 changed files with 33 additions and 7 deletions

View file

@ -1,16 +1,42 @@
_:
let
server_name = "jdonszelmann.nl";
domain = "matrix.${server_name}";
port = 11001;
in {
services.nginx.virtualHosts.${server_name} = {
in
{
services.nginx.virtualHosts.${domain} = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://[::1]:${port}";
locations."/_matrix" = {
proxyPass = "http://[::1]:${toString port}";
proxyWebsockets = true;
};
locations."/_synapse/client" = {
proxyPass = "http://[::1]:${toString port}";
proxyWebsockets = true;
};
};
services.nginx.virtualHosts.${server_name} = {
enableACME = true;
forceSSL = true;
locations."/.well-known/matrix/client".extraConfig = ''
add_header Content-Type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '${
builtins.toJSON {
"m.homeserver".base_url = "https://${domain}";
"m.identity_server" = { };
}
}';
'';
locations."/.well-known/matrix/server".extraConfig = ''
add_header Content-Type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON { "m.server" = "${domain}:443"; }}';
'';
};
services.matrix-synapse = {