From 442c691933cf2ec7dd41cedf9886ccf271187326 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 4 Feb 2021 17:19:34 +0100 Subject: [PATCH] matrix: proxy calls to '/_synapse/client' --- services/matrix.nix | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/services/matrix.nix b/services/matrix.nix index f6782e8..a83f6db 100644 --- a/services/matrix.nix +++ b/services/matrix.nix @@ -78,13 +78,21 @@ in forceSSL = true; useACMEHost = "${domain}"; - # Or do a redirect instead of the 404, or whatever is appropriate for you. - # But do not put a Matrix Web client here! See the Element web section below. - locations."/".return = "404"; + locations = + let + proxyToClientPort = { + proxyPass = "http://[::1]:${toString clientPort.private}"; + }; + in + { + # Or do a redirect instead of the 404, or whatever is appropriate + # for you. But do not put a Matrix Web client here! See the + # Element web section below. + "/".return = "404"; - locations."/_matrix" = { - proxyPass = "http://[::1]:${toString clientPort.private}"; - }; + "/_matrix" = proxyToClientPort; + "/_synapse/client" = proxyToClientPort; + }; listen = [ { addr = "0.0.0.0"; port = clientPort.public; ssl = true; }