From 05ade03e7addac3184adce31975d41c9fbbf1f43 Mon Sep 17 00:00:00 2001 From: moritzdietz Date: Sat, 10 Jul 2021 19:15:14 +0200 Subject: [PATCH 1/3] Add delegation example to the caddy reverse proxy section Signed-off-by: Moritz Dietz moritz@moritzdietz.com --- changelog.d/10368.doc | 1 + docs/reverse_proxy.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 changelog.d/10368.doc diff --git a/changelog.d/10368.doc b/changelog.d/10368.doc new file mode 100644 index 000000000000..10297aa424a5 --- /dev/null +++ b/changelog.d/10368.doc @@ -0,0 +1 @@ +Add delegation example for caddy in the reverse proxy documentation. Contributed by @moritzdietz. diff --git a/docs/reverse_proxy.md b/docs/reverse_proxy.md index 01db466f96e5..96615309a659 100644 --- a/docs/reverse_proxy.md +++ b/docs/reverse_proxy.md @@ -98,6 +98,37 @@ example.com:8448 { reverse_proxy http://localhost:8008 } ``` +[Delegation](delegate.md) example: +``` +(matrix-well-known-header) { + # Headers + header Access-Control-Allow-Origin "*" + header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" + header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization" + header Content-Type "application/json" +} + +example.com { + handle /.well-known/matrix/server { + import matrix-well-known-header + respond `{"m.server":"matrix.example.com:8448"}` + } + + handle /.well-known/matrix/client { + import matrix-well-known-header + respond `{"m.homeserver":{"base_url":"https://matrix.example.com"},"m.identity_server":{"base_url":"https://identity.example.com}}` + } +} + +matrix.example.com { + reverse_proxy /_matrix/* http://localhost:8008 + reverse_proxy /_synapse/client/* http://localhost:8008 +} + +matrix.example.com:8448 { + reverse_proxy http://localhost:8008 +} +``` ### Apache From f2b5ff475e5c856915f30d2ca343c93595a25e9e Mon Sep 17 00:00:00 2001 From: moritzdietz Date: Sun, 11 Jul 2021 14:09:19 +0200 Subject: [PATCH 2/3] Applying review suggestions --- docs/reverse_proxy.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/reverse_proxy.md b/docs/reverse_proxy.md index 96615309a659..4a4ead3a5e67 100644 --- a/docs/reverse_proxy.md +++ b/docs/reverse_proxy.md @@ -111,7 +111,7 @@ example.com:8448 { example.com { handle /.well-known/matrix/server { import matrix-well-known-header - respond `{"m.server":"matrix.example.com:8448"}` + respond `{"m.server":"matrix.example.com:443"}` } handle /.well-known/matrix/client { @@ -124,10 +124,6 @@ matrix.example.com { reverse_proxy /_matrix/* http://localhost:8008 reverse_proxy /_synapse/client/* http://localhost:8008 } - -matrix.example.com:8448 { - reverse_proxy http://localhost:8008 -} ``` ### Apache From ece201f1a5013a8a9fce25f5f1cc6afa96f1f8b6 Mon Sep 17 00:00:00 2001 From: moritzdietz Date: Mon, 12 Jul 2021 20:39:56 +0200 Subject: [PATCH 3/3] Fix typo --- docs/reverse_proxy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reverse_proxy.md b/docs/reverse_proxy.md index 4a4ead3a5e67..0f3fbbed8b02 100644 --- a/docs/reverse_proxy.md +++ b/docs/reverse_proxy.md @@ -116,7 +116,7 @@ example.com { handle /.well-known/matrix/client { import matrix-well-known-header - respond `{"m.homeserver":{"base_url":"https://matrix.example.com"},"m.identity_server":{"base_url":"https://identity.example.com}}` + respond `{"m.homeserver":{"base_url":"https://matrix.example.com"},"m.identity_server":{"base_url":"https://identity.example.com"}}` } }