Notification server behind caddy

i’m running seafile 11.0.5 behind a caddy webserver. i’m having trouble adjusting the notification server configuration to my Caddyfile.

i have this in my seafile.conf:

[notification]
enabled = true
host = 127.0.0.1
port = 8083
log_level = info
jwt_private_key = <private key>

and currently this in my Caddyfile:

seafile.example.com:<port> {
  handle /seafile* {
    reverse_proxy http://127.0.0.1:8000
  }

  handle_path /notification* {
    reverse_proxy http://127.0.0.1:8083
  }

  handle_path /seafhttp* {
    reverse_proxy http://127.0.0.1:8082
  }

  handle_path /seafmedia* {
    rewrite * /media{uri}
    root * /srv/seafile/seafile-server-latest/seahub
    file_server
  }

  handle_path /seafdav* {
    reverse_proxy http://127.0.0.1:8080
  }
}

it all works fine, except for the notification server. all i get is an error that the page could not be found if i requested https://seafile.example.com:<port>/seafile/notification/ping/ or https://seafile.example.com:<port>/notification/ping/.

note that seafile is configured to use both a custom port and a non-root subfolder. i tried prefixing the handle with the subfolder, still no success. has anyone successfully configured this with caddy yet?

i’ve made some progress. i’ve placed the notification section at the beginning, i.e., before handle /seafile*, and it now reads:

  handle_path /seafile/notification/* {
    @websockets {
      header Connection *Upgrade*
      header Upgrade    websocket
    }
    reverse_proxy @websockets http://127.0.0.1:8083
  }

this at least does not throw errors any longer when https://seafile.example.com:<port>/seafile/notification/ping/ is visited. however, i don’t get the {"ret": "pong"} reply that querying http://127.0.0.1:8083/ping locally gives.