From 302e4473f1f1147a6d54f6946f4d576f7c84e32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Fri, 29 Apr 2022 21:35:33 +0100 Subject: [PATCH] Expose matrix-dendrite --- config/services/matrix-media-repo.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/config/services/matrix-media-repo.nix b/config/services/matrix-media-repo.nix index 4e99abd8..6bb1b213 100644 --- a/config/services/matrix-media-repo.nix +++ b/config/services/matrix-media-repo.nix @@ -71,4 +71,30 @@ in "DATABASE matrix_media_repo" = "ALL PRIVILEGES"; }; }]; + services.nginx.virtualHosts."matrix.chir.rs" = { + locations."/_matrix" = { + proxyPass = "https://matrix.int.chir.rs"; + proxyWebsockets = true; + extraConfig = '' + proxy_ssl_server_name on; + ''; + }; + locations."/_matrix/media" = { + proxyPass = "http://localhost:8008"; + proxyWebsockets = true; + }; + }; + services.nginx.virtualHosts."chir.rs" = { + locations."/.well-known/matrix/server" = { + extraConfig = '' + return 200 '{ "m.server": "matrix.chir.rs:443" }'; + ''; + }; + locations."/.well-known/matrix/client" = { + extraConfig = '' + add_header Access-Control-Allow-Origin '*'; + return 200 '{ "m.homeserver": { "base_url": "matrix.chir.rs:443" } }'; + ''; + }; + }; }