conduit: Add Element X support

This commit is contained in:
Tristan Daniël Maat 2023-09-18 04:17:16 +02:00
parent 355ae4b70b
commit ab5e088016
Signed by: tlater
GPG key ID: 49670FD774E43268

View file

@ -207,12 +207,28 @@ in {
merge_slashes off; merge_slashes off;
''; '';
locations."/_matrix" = { locations = {
"/_matrix" = {
proxyPass = "http://${cfg.settings.global.address}:${toString cfg.settings.global.port}"; proxyPass = "http://${cfg.settings.global.address}:${toString cfg.settings.global.port}";
# Recommended by conduit # Recommended by conduit
extraConfig = '' extraConfig = ''
proxy_buffering off; proxy_buffering off;
''; '';
}; };
# Add Element X support
# TODO(tlater): Remove when no longer required: https://github.com/vector-im/element-x-android/issues/1085
"=/.well-known/matrix/client" = {
alias = pkgs.writeText "well-known-matrix-client" (builtins.toJSON {
"m.homeserver".base_url = "https://${domain}";
"org.matrix.msc3575.proxy".url = "https://${domain}";
});
extraConfig = ''
default_type application/json;
add_header Access-Control-Allow-Origin "*";
'';
};
};
}; };
} }