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

HAProxy delegation example #12501

Merged
merged 5 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/12501.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HAProxy delegation example with CORS headers.
villepeh marked this conversation as resolved.
Show resolved Hide resolved
22 changes: 22 additions & 0 deletions docs/reverse_proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,28 @@ backend matrix
server matrix 127.0.0.1:8008
```


[Delegation](delegate.md) example:
```
frontend https
acl wellknownc path /.well-known/matrix/client
acl wellknowns path /.well-known/matrix/server
use_backend WKcli if wellknownc
use_backend WKserv if wellknowns

backend WKcli
http-after-response set-header Access-Control-Allow-Origin "*"
http-after-response set-header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
http-after-response set-header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
http-request return status 200 content-type application/json string '{"m.homeserver":{"base_url":"https://matrix.example.com"}}'

backend WKserv
http-after-response set-header Access-Control-Allow-Origin "*"
http-after-response set-header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
http-after-response set-header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
http-request return status 200 content-type application/json string '{"m.server":"matrix.example.com:443"}'
villepeh marked this conversation as resolved.
Show resolved Hide resolved
```

### Relayd

```
Expand Down