Add CORS to nginx config
Without this entry, setups where users have the homeserver on the URL
matrix.myurl.com but want the servername to be myurl.com don't work by default
since clients like element.io can't connect to the homeserver
MODIFY
docs/nginx/monolith-sample.conf
docs/nginx/monolith-sample.conf
@@ -16,6 +16,9 @@ server {
}
location /.well-known/matrix/client {
+ # If your sever_name here doesn't match your matrix homeserver URL
+ # (e.g. hostname.com as server_name and matrix.hostname.com as homeserver URL)
+ # add_header Access-Control-Allow-Origin '*';
return 200 '{ "m.homeserver": { "base_url": "https://my.hostname.com" } }';
}

MODIFY
docs/nginx/polylith-sample.conf
docs/nginx/polylith-sample.conf
@@ -16,6 +16,9 @@ server {
}
location /.well-known/matrix/client {
+ # If your sever_name here doesn't match your matrix homeserver URL
+ # (e.g. hostname.com as server_name and matrix.hostname.com as homeserver URL)
+ # add_header Access-Control-Allow-Origin '*';
return 200 '{ "m.homeserver": { "base_url": "https://my.hostname.com" } }';
}

Add CORS to nginx config (#1791)

Without this entry, setups where users have the homeserver on the URL
matrix.myurl.com but want the servername to be myurl.com don't work by default
since clients like element.io can't connect to the homeserver