diff --git a/README.md b/README.md index d6139a5a..54dd31ac 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ This is just a summary for the impatient. See the full [documentation](https://matrix-construct.github.io/tuwunel/). > [!TIP] -> Avoid using a sub-domain for your `server_name`. You can always delegate later with a [`.well-known`](https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md) +> Avoid using a sub-domain for your `server_name`. You can always delegate later with a [`.well-known`](https://matrix-construct.github.io/tuwunel/deploying/root-domain-delegation.html) > file, but you can never change your `server_name`. **2.** Setup TLS certificates. Most users enjoy the [Caddy](https://caddyserver.com/) reverse-proxy diff --git a/docs/deploying/root-domain-delegation.md b/docs/deploying/root-domain-delegation.md index 3e2276a0..b2f60104 100644 --- a/docs/deploying/root-domain-delegation.md +++ b/docs/deploying/root-domain-delegation.md @@ -92,11 +92,28 @@ At a minimum, the following JSON files should be created: ### Option 2: Reverse proxy -This is an example configuration if `example.com` is reverse-proxied behing Nginx. +These are example configurations if `example.com` is reverse-proxied behing Nginx or Caddy. > [!NOTE] > Replace `tuwunel` with the URL where tuwunel is listening; this may look like `127.0.0.1:8008`, `matrix.example.com`, or `tuwunel` if you declared an `upstream tuwunel` block. +> [!IMPORTANT] +> These configurations need to be applied to the reverse proxy for `example.com`, **not** `matrix.example.com`. + +#### Caddy + + + +```caddy +example.com { + reverse_proxy /.well-known/matrix/* https://matrix.example.com { + header_up Host {upstream_hostport} + } +} +``` + +#### Nginx + ```nginx,hidelines=~ server { ~listen 443 ssl http2; @@ -116,3 +133,9 @@ server { ## Testing Navigate to `example.com/.well-known/matrix/client` and `example.com/.well-known/matrix/server`. These should display results similar to the [JSON snippets above](#option-1-static-json-files). + +Entering `example.com` in the [Matrix federation tester](https://federationtester.matrix.org/) should also work. + +## Additional resources + +For a more complete guide, see the Matrix setup with Ansible and Docker [documentation on setting up `.well-known`](https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md).