Webdav and traefik - how?

Hi,

currently i try to setup seafile as a Docker container behind a traefik reverse proxy. I am using the official image. The Web frontend is accessible, and the Android app connects to the instance, so for now, i try to setup webdav.

I have already figured out that i need to enable it manually in docker_datadir/seafile/conf/seafdav.conf but i have no luck accessing it via dav2fs-mount on debian.

In the config file it has the share_name option, which is set to /. I tried to mount it just with https://seafile.mydomain.tld, with no luck (Error 302). I read something about the /seafdavsuffix, so i tried it was well in the mount command (Error 302).

After that, i tried setting the share_name to /seafdav, and tried to mount it with both / and /seavdav url (both Error 502).

I see that the image brings its own nginx to reverse proxy to seafile’s web server, and that one is just supposed to point traefik to the container’s port 80. But since i needed to manually activate webdav in the config file, maybe i need to do other tweaks?

Has anyone an idea?

Just in case someone is still struggling with this issue, the solution is to add the following lines to your docker-compose file in the label section:

labels:
  - traefik.enable=true
  - traefik.frontend.rule=Host:seafile.${DOMAINNAME}
  - traefik.backend=seafile
  - traefik.port=80   
  - traefik.webdav.frontend.rule=Host:seafile.${DOMAINNAME}
  - traefik.webdav.port=8080
  - traefik.webdav.backend=seafileDav
  - traefik.docker.network=proxy  

here you explicitly define the webdav port to your container running seafile. Furthermore you need to adjust your seafdav.conf to look like this:

[WEBDAV]
enabled = true
port = 8080
fastcgi = true
share_name = /seafdav

You should just expose the port 80 with traefik.enable set to true and point your client to https://seafile.mydomain.tld/seafdav/

Just make sure your seafdav.conf looks like suggested by @hjkl:

[WEBDAV]
enabled = true
port = 8080
fastcgi = true
share_name = /seafdav

Nginx just takes care of exposing /seafdav correctly, so it is not necessary to expose webdav through Traefik:

[...]
    location /seafdav {
        client_max_body_size 0;
        fastcgi_pass    127.0.0.1:8080;
[...]

If you still want to use Traefik to expose Webdav:

The labels suggested by @hjkl for Traefik are somewhat wrong. With the suggested labels, it is impossible for Traefik to distinguish web UI from webdav traffic. You should add the path to the webdav rule:

traefik.webdav.frontend.rule=Host:seafile.${DOMAINNAME};/seafdav

1 Like

this is not needed anymore in the new versions