content

Matrix federation fails because .well-known is served with the incorrect CORS headers

When serving the .well-known files for a Matrix server with a 301 redirect, federation can fail because the CORS headers have not been set. 1

To fix this, add the Access-Control-Allow-Origin header to the redirect response. For example, with an .htaccess file: 1

 Redirect 301 /.well-known https://matrix.example.com/.well-known
+Header always add Access-Control-Allow-Origin: "*"

meta

tags: matrix

created: modified:

backlinks: How to remove the subdomain from a matrix server name

commit: 269ac179