Example: Collabora CODE

Collabora CODE (port from https://github.com/caddyserver/examples/tree/master/collabora)

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 {
1 Like

@morph027 I drastically simplified the Caddyfile using Caddy v2’s named matchers in your post. Could you verify that it still works as intended?

Thanks for porting the example!

Jip, works. But why? According to the docs, named matchers are AND’ed …

The paragraph right below the one you read:

For most matchers that accept multiple values, those values are OR’ed; i.e. one must match in order for the matcher to match.

Since each of those are the same matcher (i.e. path) they get merged into one. I could just as easily put them all on one line, but I decided against it because I wanted to preserve the comments :+1: