Seadoc Server Caddy configuration

I’m running Seafile pro 11.04 (manual install on Ubuntu 22.04) with the latest Seadoc version. I had to open port 3306 on ufw, and set the bind_address to in MySQL before Seadoc could connect to my database. I think it would be helpful to include this in the install notes because it took me awhile to figure out why it was unable to connect.

On a side note, I just updated from Ubuntu 20.04 to 22.04 yesterday. Seafile/Seahub worked with Python 3.12.2 on Ubuntu 20.04, but Seahub stopped working after I updated. I now have to set Python 3.10 as my default or Seahub fails to start.

The Seadoc converter works, and I can edit .md files, but whenever I open an sdoc file I get an error that the server has disconnected and I’m unable to do anything (see the below screenshot).

Here are my settings:


    image: seafileltd/sdoc-server:latest
    container_name: sdoc-server
      # - 80:80
      # - 443:443
      - 7070:7070
      - 8888:8888
      - '/opt/seafile/sdoc-data/:/shared'
      - DB_HOST=
      - DB_PORT=3306
      - DB_USER=seafile
      - DB_PASSWD=db-password
      - DB_NAME=sdoc-db
       - TIME_ZONE=UTC
       - # ive also tried
     restart: always

caddy (for seadocs) {
  tls /etc/caddy/certs/*

  @options {
    method OPTIONS
  header {
    Access-Control-Allow-Origin *
    Access-Control-Allow-Credentials true
    Access-Control-Allow-Methods *
    Access-Control-Allow-Headers *
  reverse_proxy {
    header_down -Access-Control-Allow-Origin
  respond @options 204

  handle_path /* {

caddy (for Seafile) {
  tls /etc/caddy/certs/*


  handle_path /seafhttp* {

  handle_path /media* {
    root *


It is likely the proxy settings for not work correctly.

I’ve tried everything I can think of but haven’t been able to get it working, such as the following:

  handle_path /* {

    @websockets {
      header Connection *Upgrade*
      header Upgrade websockets
    reverse_proxy @websockets


I’ll try it with nginx tomorrow and see if it works. If it does, I’ll look for help on the caddy forums.

I was able to get Seadoc to work with nginx, although sdoc files do not work with iOS browsers. You can edit markdown files on your phone, and view sdoc files, but you can’t edit sdoc files.

I was able to get this to work with caddy by changing the configuration to the following:

  handle_path /* {
    rewrite * /{path}
    reverse_proxy localhost:7070

Mobile editing does not supported yet.