Add Caddy 2 example (#7463)

The specific headers that are passed using this new configuration format
are Host and X-Forwarded-For, which should be all that's required.

Note that for production another matcher should be added in the first
section to properly handle the base_url lookup:
reverse_proxy /.well-known/matrix/* http://localhost:8008

Signed-off-by: Jeff Peeler <jpeeler@gmail.com>
This commit is contained in:
Jeff Peeler 2020-05-15 09:36:01 -04:00 committed by GitHub
parent e9f3de0bab
commit 572b444dab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

1
changelog.d/7463.doc Normal file
View File

@ -0,0 +1 @@
Add additional reverse proxy example for Caddy v2. Contributed by Jeff Peeler.

View File

@ -62,7 +62,7 @@ the reverse proxy and the homeserver.
> **NOTE**: Do not add a `/` after the port in `proxy_pass`, otherwise nginx will
canonicalise/normalise the URI.
### Caddy
### Caddy 1
matrix.example.com {
proxy /_matrix http://localhost:8008 {
@ -76,6 +76,16 @@ canonicalise/normalise the URI.
}
}
### Caddy 2
matrix.example.com {
reverse_proxy /_matrix/* http://localhost:8008
}
example.com:8448 {
reverse_proxy http://localhost:8008
}
### Apache
<VirtualHost *:443>