element-hq / element-hq/element-call
Discrepancy between self-hosting.md and blog post
- Dominant language
- TypeScript
- Stars
- 996
- Forks
- 213
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 55
Description
### Steps to reproduce
We were trying to self-host MatrixRTC without also running Element Call, but the discrepancy between self-hosting.md and Will Lewis’s [blog post](https://willlewis.co.uk/blog/posts/deploy-element-call-backend-with-synapse-and-docker-compose/) proved confusing.
The following part from his Apache configuration doesn’t have a counterpart in the nginx version:
```apache
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "POST"
Header set Access-Control-Allow-Headers "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token"
ProxyPreserveHost on
ProxyAddHeaders on
ProxyPass "http://localhost:8070/sfu/get"
ProxyPassReverse "http://localhost:8070/sfu/get"
```
We tried:
```nginx
location = /sfu/get {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods POST;
add_header Access-Control-Allow-Headers "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:8070/sfu/get;
}
```
### Outcome
#### What did you expect?
A working RTC instance like https://livekit-jwt.call.matrix.org, which we hope won’t be discontinued just yet.
#### What happened instead?
With the addition mentioned above, we got
```sh
"OPTIONS /sfu/get HTTP/1.1" 200 490->0 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" - https://mrtc.domain:443 "/usr/local/nginx/html/sfu/get"
```
Without the addition (ie following self-hosting.md alone), this request made by Element X client returned a 404.
~~But neither got us a working setup and we got stuck in ‘Waiting for media’ in every call.~~
The audio and video now appear, but only when one gets `/sfu/get` proxied. (Earlier we had configuration issues with livekit and lk-jwt, which were fixed.)
### Operating system
Almalinux 10
### Will you send logs?
Will send on request.
Contributor guide
Assessment
This issue has not been assessed yet.