Make traefik+nginx config more self-contained

The nginx instance which is serving the .well-known endpoints can serve
the simple JSON replies directly from memory, instead of having them
as external files on disk.
merge-requests/239/head
Ticho 34782694 3 years ago
parent 9b57c89df6
commit b746f17e56

@ -94,26 +94,20 @@ So...step by step:
server_name <SUBDOMAIN>.<DOMAIN>; server_name <SUBDOMAIN>.<DOMAIN>;
listen 80 default_server; listen 80 default_server;
location /.well-known/matrix/ { location /.well-known/matrix/server {
root /var/www; return 200 '{"m.server": "<SUBDOMAIN>.<DOMAIN>:443"}';
default_type application/json; add_header Content-Type application/json;
add_header Access-Control-Allow-Origin *;
} }
}
```
- `./nginx/www/.well-known/matrix/client` (relative to the compose file, you can change this, but then also need to change the volume mapping) location /.well-known/matrix/client {
```json return 200 '{"m.homeserver": {"base_url": "https://<SUBDOMAIN>.<DOMAIN>"}}';
{ add_header Content-Type application/json;
"m.homeserver": { add_header "Access-Control-Allow-Origin" *;
"base_url": "https://<SUBDOMAIN>.<DOMAIN>" }
}
} location / {
``` return 404;
- `./nginx/www/.well-known/matrix/server` (relative to the compose file, you can change this, but then also need to change the volume mapping) }
```json
{
"m.server": "<SUBDOMAIN>.<DOMAIN>:443"
} }
``` ```

Loading…
Cancel
Save