I have searched the whole web on how to setup CryptPad with Caddy and didn't find anything. And since I got it to work, I wanted to share a working Caddyfile here:
(cryptpad) {
header {
Strict-Transport-Security "max-age=63072000; includeSubDomains"
}
handle /* {
reverse_proxy localhost:3000
}
handle /cryptpad_websocket {
reverse_proxy localhost:3003
}
}
MAIN_DOMAIN {
import cryptpad
}
SANDBOX_DOMAIN {
import cryptpad
}
Of course the localhost:3000 and localhost:3003 need to be adjusted to the real address on the server.
And the MAIN_DOMAIN and SANDBOX_DOMAIN have to be replaced with the corresponding entries from the config.js