Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Add CORS to nginx config (#1791)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Cogitri authored Jun 7, 2021
1 parent caa5c89 commit 2c9a390
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/nginx/monolith-sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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" } }';
}

Expand Down
3 changes: 3 additions & 0 deletions docs/nginx/polylith-sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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" } }';
}

Expand Down

0 comments on commit 2c9a390

Please sign in to comment.