Caddy reverse proxy for Seafile

I would like to share a Caddy reverse proxy working config file for anyone else that may be looking for help. I’ve spent quite some time figuring it out.

The option that was missing for me was uri strip_prefix seafhttp.
Tried the rewrite * {path} but that did not work. I may not comprehend what rewrite does vs uri strip_prefix.

I hope someone finds this useful while searching online.

cloud.mydomain.com {
handle /seafhttp* {
uri strip_prefix seafhttp
reverse_proxy [Private_IP]:8082
}
handle {
reverse_proxy [Private_IP]:8000
}
}

I have only one small issue with seafile, the avatar icon does not load. The request url that is shown contains the internal IP of the seafile server and not the public domain that the reverse proxy is serving.

Request URL: http://[Private_IP]/media/avatars/default.png

1 Like

you might like to have a look at the Caddyfile i came up with, it also loads avatars. note the use of handle_path instead of handle, it automatically does the stripping. also note that the example configures seafile in a non-root directory (e.g. https://seafile.example.com/seafile/ instead of https://seafile.example.com). if seafile resides at root level, simply replace the initial handle /seafile* with handle.

i’m only having trouble getting the notification server to work.

Thank you, will run it to test it out. However the avatar icons don’t load regardless of me using a proxy or connecting to it directly.

the missing /seafmedia* part could be responsible.

The afatar icons don’t show up regardless of using a proxy or not.

I tried with Caddy too, but failed to integrate onlyoffice correctly with Caddy, so I moved to a container with nginx and integrated certbot.
I can definitely recommend that :wink: