Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 95d869c

Browse files
Add /_synapse/client to the reverse proxy docs (#8227)
This PR adds a information about forwarding `/_synapse/client` endpoints through your reverse proxy. The first of these endpoints are introduced in #8004.
1 parent 5d3e306 commit 95d869c

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

UPGRADE.rst

+16-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Shared rooms endpoint (MSC2666)
77
This release contains a new unstable endpoint `/_matrix/client/unstable/uk.half-shot.msc2666/user/shared_rooms/.*`
88
for fetching rooms one user has in common with another. This feature requires the
99
`update_user_directory` config flag to be `True`. If you are you are using a `synapse.app.user_dir`
10-
worker, requests to this endpoint must be handled by that worker.
10+
worker, requests to this endpoint must be handled by that worker.
1111
See `docs/workers.md <docs/workers.md>`_ for more details.
1212

1313

@@ -91,6 +91,21 @@ for example:
9191
Upgrading to v1.21.0
9292
====================
9393

94+
Forwarding ``/_synapse/client`` through your reverse proxy
95+
----------------------------------------------------------
96+
97+
The `reverse proxy documentation
98+
<https://github.com/matrix-org/synapse/blob/develop/docs/reverse_proxy.md>`_ has been updated
99+
to include reverse proxy directives for ``/_synapse/client/*`` endpoints. As the user password
100+
reset flow now uses endpoints under this prefix, **you must update your reverse proxy
101+
configurations for user password reset to work**.
102+
103+
Additionally, note that the `Synapse worker documentation
104+
<https://github.com/matrix-org/synapse/blob/develop/docs/workers.md>`_ has been updated to
105+
state that the ``/_synapse/client/password_reset/email/submit_token`` endpoint can be handled
106+
by all workers. If you make use of Synapse's worker feature, please update your reverse proxy
107+
configuration to reflect this change.
108+
94109
New HTML templates
95110
------------------
96111

changelog.d/8227.doc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add `/_synapse/client` to the reverse proxy documentation.

docs/reverse_proxy.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ privileges.
1111

1212
**NOTE**: Your reverse proxy must not `canonicalise` or `normalise`
1313
the requested URI in any way (for example, by decoding `%xx` escapes).
14-
Beware that Apache *will* canonicalise URIs unless you specifify
14+
Beware that Apache *will* canonicalise URIs unless you specify
1515
`nocanon`.
1616

1717
When setting up a reverse proxy, remember that Matrix clients and other
@@ -23,6 +23,10 @@ specification](https://matrix.org/docs/spec/server_server/latest#resolving-serve
2323
for more details of the algorithm used for federation connections, and
2424
[delegate.md](<delegate.md>) for instructions on setting up delegation.
2525

26+
Endpoints that are part of the standardised Matrix specification are
27+
located under `/_matrix`, whereas endpoints specific to Synapse are
28+
located under `/_synapse/client`.
29+
2630
Let's assume that we expect clients to connect to our server at
2731
`https://matrix.example.com`, and other servers to connect at
2832
`https://example.com:8448`. The following sections detail the configuration of
@@ -45,7 +49,7 @@ server {
4549
4650
server_name matrix.example.com;
4751
48-
location /_matrix {
52+
location ~* ^(\/_matrix|\/_synapse\/client) {
4953
proxy_pass http://localhost:8008;
5054
proxy_set_header X-Forwarded-For $remote_addr;
5155
# Nginx by default only allows file uploads up to 1M in size
@@ -65,6 +69,10 @@ matrix.example.com {
6569
proxy /_matrix http://localhost:8008 {
6670
transparent
6771
}
72+
73+
proxy /_synapse/client http://localhost:8008 {
74+
transparent
75+
}
6876
}
6977
7078
example.com:8448 {
@@ -79,6 +87,7 @@ example.com:8448 {
7987
```
8088
matrix.example.com {
8189
reverse_proxy /_matrix/* http://localhost:8008
90+
reverse_proxy /_synapse/client/* http://localhost:8008
8291
}
8392
8493
example.com:8448 {
@@ -96,6 +105,8 @@ example.com:8448 {
96105
AllowEncodedSlashes NoDecode
97106
ProxyPass /_matrix http://127.0.0.1:8008/_matrix nocanon
98107
ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix
108+
ProxyPass /_synapse/client http://127.0.0.1:8008/_synapse/client nocanon
109+
ProxyPassReverse /_synapse/client http://127.0.0.1:8008/_synapse/client
99110
</VirtualHost>
100111
101112
<VirtualHost *:8448>
@@ -119,6 +130,7 @@ frontend https
119130
# Matrix client traffic
120131
acl matrix-host hdr(host) -i matrix.example.com
121132
acl matrix-path path_beg /_matrix
133+
acl matrix-path path_beg /_synapse/client
122134
123135
use_backend matrix if matrix-host matrix-path
124136
@@ -146,3 +158,10 @@ connecting to Synapse from a client.
146158
Synapse exposes a health check endpoint for use by reverse proxies.
147159
Each configured HTTP listener has a `/health` endpoint which always returns
148160
200 OK (and doesn't get logged).
161+
162+
## Synapse administration endpoints
163+
164+
Endpoints for administering your Synapse instance are placed under
165+
`/_synapse/admin`. These require authentication through an access token of an
166+
admin user. However as access to these endpoints grants the caller a lot of power,
167+
we do not recommend exposing them to the public internet without good reason.

docs/workers.md

+1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ expressions:
217217
^/_matrix/client/(api/v1|r0|unstable)/joined_groups$
218218
^/_matrix/client/(api/v1|r0|unstable)/publicised_groups$
219219
^/_matrix/client/(api/v1|r0|unstable)/publicised_groups/
220+
^/_synapse/client/password_reset/email/submit_token$
220221

221222
# Registration/login requests
222223
^/_matrix/client/(api/v1|r0|unstable)/login$

0 commit comments

Comments
 (0)