Delegation
Delegation is a Matrix feature allowing a homeserver admin to retain an URL of example.com so that user IDs, etc. continue to look like *:example.com
, whilst having federation traffic routed to a different server and/or port (e.g. matrix.example.com:443
). There are multiple ways to do this. This includes with the .well-known
file and SRV DNS records.
.well-known delegation[edit | edit source]
To use this method, you need to be able to configure the server at https://<server_name>
to serve a file at https://<server_name>/.well-known/matrix/server
. There are two ways to do this, shown below.
Using a web server[edit | edit source]
This is the more commonly used method, and is the only method if you are using server software that is not Synapse. You need to configure a server such as nginx or Apache to serve the https://<server_name>/.well-known/matrix/server
file. Setting up such a server is out of the scope of the wiki, but note that it is often possible to configure your reverse proxy for this.
The URL https://<server_name>/.well-known/matrix/server
should be configured to return a JSON structure containing the key m.server
like this:
{ "m.server": "<synapse.server.name>[:<yourport>]" }
Using Synapse's built in method[edit | edit source]
If you are able to set up your domain so that https://<server_name>
is routed to Synapse (i.e., the only change needed is to direct federation traffic to port 443 instead of port 8448), then it is possible to configure Synapse to serve a suitable .well-known/matrix/server
file. To do so, add the following to your homeserver.yaml
file:
serve_server_wellknown: true
SRV DNS record delegation[edit | edit source]
To set up SRV DNS record delegation, create a SRV DNS record with _matrix-fed._tcp.<hostname>
that points to the delegated hostname.