@@ -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```
10585matrix.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
11090example.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+ ```
12498example.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
136105matrix.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