Benenne Matrix-Discovery-Dateien in JSON um

This commit is contained in:
Moritz Klein 2026-05-31 13:39:59 +02:00
parent 17b751262c
commit 11508a8139
4 changed files with 24 additions and 3 deletions

View file

@ -10,8 +10,8 @@ Matrix-Discovery-Dateien unter `.well-known/matrix/` bereit.
- Dunkle, responsive Landingpage ohne externe Frameworks - Dunkle, responsive Landingpage ohne externe Frameworks
- Klassische statische Dateien: `index.html`, `style.css`, `script.js` - Klassische statische Dateien: `index.html`, `style.css`, `script.js`
- Matrix Homeserver Discovery: - Matrix Homeserver Discovery:
- `/.well-known/matrix/server` - `/.well-known/matrix/server` aus `.well-known/matrix/server.json`
- `/.well-known/matrix/client` - `/.well-known/matrix/client` aus `.well-known/matrix/client.json`
- Dockerfile fuer eine einfache Nginx-Auslieferung - Dockerfile fuer eine einfache Nginx-Auslieferung
## Matrix ## Matrix
@ -28,7 +28,9 @@ Matrix-Discovery-Dateien unter `.well-known/matrix/` bereit.
{"m.homeserver":{"base_url":"https://matrix.rastus01.com"}} {"m.homeserver":{"base_url":"https://matrix.rastus01.com"}}
``` ```
Wichtig: Diese Dateien haben absichtlich keine `.json`-Dateiendung. Die Dateien liegen im Repository mit `.json`-Dateiendung. Nginx liefert die
Matrix-Discovery-Endpunkte weiterhin ohne `.json` aus, damit Clients die
standardisierten URLs finden.
## Lokal mit Docker ## Lokal mit Docker

View file

@ -10,6 +10,12 @@ server {
} }
location = /.well-known/matrix/server { location = /.well-known/matrix/server {
default_type application/json;
add_header Access-Control-Allow-Origin "*" always;
try_files /.well-known/matrix/server.json =404;
}
location = /.well-known/matrix/server.json {
default_type application/json; default_type application/json;
add_header Access-Control-Allow-Origin "*" always; add_header Access-Control-Allow-Origin "*" always;
try_files $uri =404; try_files $uri =404;
@ -25,6 +31,19 @@ server {
return 204; return 204;
} }
try_files /.well-known/matrix/client.json =404;
}
location = /.well-known/matrix/client.json {
default_type application/json;
add_header Access-Control-Allow-Origin "*" always;
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
add_header Access-Control-Allow-Headers "Content-Type" always;
if ($request_method = OPTIONS) {
return 204;
}
try_files $uri =404; try_files $uri =404;
} }