Add client well-known for Matrix

This commit is contained in:
coolneng 2022-10-22 17:18:53 +02:00
parent b97f417549
commit 76ae7e1f16
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 17 additions and 6 deletions

View File

@ -15,11 +15,7 @@
sslDhparam = "/var/lib/dhparams/nginx.pem";
commonHttpConfig = ''
# Add HSTS header with preloading to HTTPS requests.
# Adding this header to HTTP requests is discouraged
map $scheme $hsts_header {
https "max-age=31536000; includeSubdomains; preload";
}
add_header Strict-Transport-Security $hsts_header;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
# Minimize information leaked to other domains
add_header 'Referrer-Policy' 'origin-when-cross-origin';
@ -45,7 +41,14 @@
"rewrite ^/gitea/(.*)$ https://git.coolneng.duckdns.org/$1 last;";
"/miniflux/".extraConfig =
"rewrite ^/miniflux/(.*)$ https://rss.coolneng.duckdns.org/$1 last;";
"/.well-known/".alias = "${../well-known}" + "/";
"/.well-known/" = {
alias = "${../well-known}" + "/";
extraConfig = ''
${config.services.nginx.commonHttpConfig}
add_header Access-Control-Allow-Origin '*';
add_header Content-Type application/json;
'';
};
};
};
"radicale.coolneng.duckdns.org" = {

8
well-known/matrix/client Normal file
View File

@ -0,0 +1,8 @@
{
"m.homeserver": {
"base_url": "https://matrix.coolneng.duckdns.org"
},
"m.identity_server": {
"base_url": "https://vector.im"
}
}