matrix-org / sliding-sync

Proxy implementation of MSC3575's sync protocol.
https://github.com/matrix-org/matrix-spec-proposals/pull/3575
Apache License 2.0
251 stars 38 forks source link

Instructions for Caddy reverse proxy #458

Open Eternumkr opened 2 months ago

Eternumkr commented 2 months ago

Please add instruction/ short guide for setting up with Caddy.

Thank you.

S7evinK commented 2 months ago
yourserver.tld {
    encode gzip
    header /.well-known/matrix/* Content-Type application/json
    header /.well-known/matrix/* Access-Control-Allow-Origin *
    respond /.well-known/matrix/server {"m.server":"yourserver.tld:443"}
    respond /.well-known/matrix/client {"m.homeserver":{"base_url":"https://yourserver.tld"},"org.matrix.msc3575.proxy":{"url":"https://yourserver.tld/sliding-sync"}}
    reverse_proxy /_matrix/* http://ipOfMatrixServer:8008 {
        transport http {
            compression on
        }
    }
    handle_path /sliding-sync/* {
        reverse_proxy http://ipOfSlidingSyncProxy:8009
    }
}

Something like this is working fine in my setup. (ipOfMatrixServer and ipOfSlidingSyncProxy are the same in my case)