@@ -79,63 +79,32 @@ server {
79
79
}
80
80
```
81
81
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
-
102
82
### Caddy v2
103
83
104
84
```
105
85
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
108
88
}
109
89
110
90
example.com:8448 {
111
- reverse_proxy http:// localhost:8008
91
+ reverse_proxy localhost:8008
112
92
}
113
93
```
94
+
114
95
[ 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
- }
123
96
97
+ ```
124
98
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"}}`
134
103
}
135
104
136
105
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
139
108
}
140
109
```
141
110
0 commit comments