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

Commit 935e73e

Browse files
authored
Update Caddy reverse proxy documentation (#13344)
Improve/simplify Caddy examples. Remove Caddy v1 (has long been EOL'ed) Signed-off-by: Matthew Holt <[email protected]>
1 parent e8519e0 commit 935e73e

File tree

2 files changed

+12
-42
lines changed

2 files changed

+12
-42
lines changed

changelog.d/13344.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve Caddy reverse proxy documentation.

docs/reverse_proxy.md

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -79,63 +79,32 @@ server {
7979
}
8080
```
8181

82-
### Caddy v1
83-
84-
```
85-
matrix.example.com {
86-
proxy /_matrix http://localhost:8008 {
87-
transparent
88-
}
89-
90-
proxy /_synapse/client http://localhost:8008 {
91-
transparent
92-
}
93-
}
94-
95-
example.com:8448 {
96-
proxy / http://localhost:8008 {
97-
transparent
98-
}
99-
}
100-
```
101-
10282
### Caddy v2
10383

10484
```
10585
matrix.example.com {
106-
reverse_proxy /_matrix/* http://localhost:8008
107-
reverse_proxy /_synapse/client/* http://localhost:8008
86+
reverse_proxy /_matrix/* localhost:8008
87+
reverse_proxy /_synapse/client/* localhost:8008
10888
}
10989
11090
example.com:8448 {
111-
reverse_proxy http://localhost:8008
91+
reverse_proxy localhost:8008
11292
}
11393
```
94+
11495
[Delegation](delegate.md) example:
115-
```
116-
(matrix-well-known-header) {
117-
# Headers
118-
header Access-Control-Allow-Origin "*"
119-
header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
120-
header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
121-
header Content-Type "application/json"
122-
}
12396

97+
```
12498
example.com {
125-
handle /.well-known/matrix/server {
126-
import matrix-well-known-header
127-
respond `{"m.server":"matrix.example.com:443"}`
128-
}
129-
130-
handle /.well-known/matrix/client {
131-
import matrix-well-known-header
132-
respond `{"m.homeserver":{"base_url":"https://matrix.example.com"},"m.identity_server":{"base_url":"https://identity.example.com"}}`
133-
}
99+
header /.well-known/matrix/* Content-Type application/json
100+
header /.well-known/matrix/* Access-Control-Allow-Origin *
101+
respond /.well-known/matrix/server `{"m.server": "matrix.example.com:443"}`
102+
respond /.well-known/matrix/client `{"m.homeserver":{"base_url":"https://matrix.example.com"},"m.identity_server":{"base_url":"https://identity.example.com"}}`
134103
}
135104
136105
matrix.example.com {
137-
reverse_proxy /_matrix/* http://localhost:8008
138-
reverse_proxy /_synapse/client/* http://localhost:8008
106+
reverse_proxy /_matrix/* localhost:8008
107+
reverse_proxy /_synapse/client/* localhost:8008
139108
}
140109
```
141110

0 commit comments

Comments
 (0)