mirror of
https://github.com/YunoHost-Apps/synapse_ynh.git
synced 2024-09-03 20:26:38 +02:00
Update .well-known redirection
for access by federation and applications like Riot.im
This commit is contained in:
parent
319f902d63
commit
00e5e53895
1 changed files with 4 additions and 10 deletions
|
@ -247,18 +247,12 @@ fi
|
|||
|
||||
# Create .well-known redirection for access by federation if it doesn't exist
|
||||
if [[ $server_name != $domain ]]; then
|
||||
if [[ ! -e /var/www/.well-known/${server_nameserver_name}/server_name.json ]]; then
|
||||
cat > /var/www/.well-known/${server_name}/server_name.json <<EOF
|
||||
{
|
||||
"m.server": "$domain"
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [[ ! -e /etc/nginx/conf.d/${server_name}.d/server_name.conf ]]
|
||||
cat > /etc/nginx/conf.d/${server_name}.d/server_name.conf <<EOF
|
||||
location /.well-known/matrix/server {
|
||||
alias /var/www/.well-known/${server_name}/server_name.json;
|
||||
location /.well-known/matrix/ {
|
||||
return 200 '{"m.server": "$domain", "m.homeserver": "https://$domain"}';
|
||||
add_header Content-Type application/json;
|
||||
add_header Access-Control-Allow-Origin '*';
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue