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
main
Rasmus Thomsen 2021-06-07 12:06:57 +02:00 committed by GitHub
parent caa5c89ecb
commit 2c9a390fa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,9 @@ server {
} }
location /.well-known/matrix/client { 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" } }'; return 200 '{ "m.homeserver": { "base_url": "https://my.hostname.com" } }';
} }

View File

@ -16,6 +16,9 @@ server {
} }
location /.well-known/matrix/client { 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" } }'; return 200 '{ "m.homeserver": { "base_url": "https://my.hostname.com" } }';
} }