From fc9fdd712662f9780a3194ed605cccd31a836263 Mon Sep 17 00:00:00 2001 From: Zolfa Date: Tue, 28 Apr 2020 21:16:31 +0200 Subject: [PATCH] roles/matrix-synapse: got federation working This is beacause nginx will do canonization of URIs before proxy-passing if you add anything after the port host:port. For example, with: location /anything { proxy_pass http://127.0.0.1:8008/anything; } NGINX will perform canonization, but with: location /anything { proxy_pass http://127.0.0.1:8008 # With NO Trailing slash } NGINX will pass the unaltered original request, included /anything, to the upstream server. Canonization leads to problem when federating to other matrix-synapse instances. The observed bug was: - User A on our server (@A:our.server) invites User B on external server (@B:matrix.org). - User B correctly receive the invite. - User B try to join the room but the request timeout. - On our.sever logs we see "signature tampered" errors related to incoming connection from the external server (matrix.org). This commit fix the issue. --- roles/matrix-synapse/defaults/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/matrix-synapse/defaults/main.yaml b/roles/matrix-synapse/defaults/main.yaml index 83b11ed..23b2087 100644 --- a/roles/matrix-synapse/defaults/main.yaml +++ b/roles/matrix-synapse/defaults/main.yaml @@ -1,7 +1,7 @@ --- server_fqdn: '{{ ansible_hostname }}.{{ domain }}' proxy_location_path: "_matrix" -remote_host: "http://127.0.0.1:8008/_matrix" +remote_host: "http://127.0.0.1:8008" matrix_domain: '{{ domain }}' ldap_server: 'ldap1.dmz.{{ domain }}' ldap_domain: '{{ domain }}'