summary refs log tree commit diff
path: root/docs/reverse_proxy.md
diff options
context:
space:
mode:
authorvillepeh <100730729+villepeh@users.noreply.github.com>2022-04-25 15:18:18 +0300
committerGitHub <noreply@github.com>2022-04-25 13:18:18 +0100
commitd9b71410c28320f67e4816257e56ac44492ffa28 (patch)
tree7349c608207d9aa193abcc3dc5b1609979a2aa29 /docs/reverse_proxy.md
parentAdd some example configurations for worker (#12492) (diff)
downloadsynapse-d9b71410c28320f67e4816257e56ac44492ffa28.tar.xz
Add HAProxy delegation example to docs (#12501)
Signed-off-by: Ville Petteri Huh
Diffstat (limited to 'docs/reverse_proxy.md')
-rw-r--r--docs/reverse_proxy.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/reverse_proxy.md b/docs/reverse_proxy.md
index 5a0c847951..69caa8a73e 100644
--- a/docs/reverse_proxy.md
+++ b/docs/reverse_proxy.md
@@ -206,6 +206,28 @@ backend matrix
   server matrix 127.0.0.1:8008
 ```
 
+
+[Delegation](delegate.md) example:
+```
+frontend https
+  acl matrix-well-known-client-path path /.well-known/matrix/client
+  acl matrix-well-known-server-path path /.well-known/matrix/server
+  use_backend matrix-well-known-client if matrix-well-known-client-path
+  use_backend matrix-well-known-server if matrix-well-known-server-path
+ 
+backend matrix-well-known-client
+  http-after-response set-header Access-Control-Allow-Origin "*"
+  http-after-response set-header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
+  http-after-response set-header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
+  http-request return status 200 content-type application/json string '{"m.homeserver":{"base_url":"https://matrix.example.com"},"m.identity_server":{"base_url":"https://identity.example.com"}}'
+
+backend matrix-well-known-server
+  http-after-response set-header Access-Control-Allow-Origin "*"
+  http-after-response set-header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
+  http-after-response set-header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
+  http-request return status 200 content-type application/json string '{"m.server":"matrix.example.com:443"}'
+```
+
 ### Relayd
 
 ```