Collabora CODE (port from examples/collabora at master · caddyserver/examples · GitHub)
This is an example configuration of how to use Collabora CODE with caddy.
Collabora can then be used with, for example, NextCloud.
Note: In this example file Collabora CODE is started using its official docker container and reachable in the internal network using https://collabora:9980.
collabora.example.com {
encode gzip
@collabora {
path /loleaflet/* # Loleaflet is the client part of LibreOffice Online
path /hosting/discovery # WOPI discovery URL
path /hosting/capabilities # Show capabilities as json
path /lool/* # Main websocket, uploads/downloads, presentations
}
reverse_proxy @collabora https://collabora:9980 {
transport http {
tls_insecure_skip_verify
}
}
}
If you review posts #5 to #8 in this thread, it appears the named matcher is probably unnecessary and may even be cloaking some useful information. If you accept this, the Caddy block above reduces to:
collabora.example.com {
encode gzip
reverse_proxy https://collabora:9980 {
transport http {
tls_insecure_skip_verify
}
}
}
Furthermore, if your Collabora container is reachable on the internal network using http://collabora:9980, the Caddy block distills down even further to:
collabora.example.com {
encode gzip
reverse_proxy http://collabora:9980
}