Skip to content

Discrepancy between self-hosting.md and blog post #3390

@nisbet-hubbard

Description

@nisbet-hubbard

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 proved confusing.

The following part from his Apache configuration doesn’t have a counterpart in the nginx version:

    <Location "/sfu/get">
        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"
    </Location>

We tried:

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

"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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-DefectSomething isn't working: bugs, crashes, hangs, vulnerabilities, or other reported problemsT-OtherQuestions, user support, anything else

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions