diff --git a/configuration/services/conduit.nix b/configuration/services/conduit.nix index 871b5e2..2d341b7 100644 --- a/configuration/services/conduit.nix +++ b/configuration/services/conduit.nix @@ -207,12 +207,28 @@ in { merge_slashes off; ''; - locations."/_matrix" = { - proxyPass = "http://${cfg.settings.global.address}:${toString cfg.settings.global.port}"; - # Recommended by conduit - extraConfig = '' - proxy_buffering off; - ''; + locations = { + "/_matrix" = { + proxyPass = "http://${cfg.settings.global.address}:${toString cfg.settings.global.port}"; + # Recommended by conduit + extraConfig = '' + 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 "*"; + ''; + }; }; }; }