13.0 CE: webdav broken due to "permanently moved" (at least on some clients)

Hi, I’ve set up a completely fresh instance of Seafile 13.0 CE according to the official 13.0 documentation, including the https steps. For simplicity I’m using the docker-based setup and I try to keep it as ‘stock’ as possible.

This is working fine.

Then I followed the documentation on enabling WebDAV: WebDAV extension - Seafile Admin Manual

I modified the original seafdav.conf that was already present by just replacing false by true:


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

After restarting I still can’t access my server via WebDAV. Gnome’s Nautilus returns “HTTP Error: Moved Permanently”.

In order to rule out a client-side issue I checked my older Seafile setup (installed via binaries) and that one does work fine.

I finally figured out that at least some clients (in my case Gnome’s webdav client built into Nautilus file browser) can’t cope with the default permanent redirect in nginx config.

I could fix it by modifying /opt/seafile-data/nginx/conf/seafile.nginx.conf as follows: remove permanent in this line:

rewrite ^/seafdav$ /seafdav/ permanent;

I’d like to suggest that you remove that permanent keyword from the default nginx config. (And retest a variety of webdav clients.)

(I also tried accessing the seafdav url in Firefox and it seemed to end up in a loop where it constantly asked for my credentials. After the mentioned change in seafile.nginx.conf it worked as expected. But with Firefox I only did a quick test so I can’t guarantee my results.)

Note that Nautilus also gave that error when I specifically entered the url with the trailing /.

Now I’m wondering if my change will be lost over time, since the seafile.nginx.conf explicitly states that it was auto-generated. How often is it regenerated? If so, will this regeneration still work if I manually edited it?

Thanks for reporting the issue. We will look into it in the next week.

Hi,
The permanent keyword is assigned to prevent errors that might occur in some clients or browsers when users forget to add the trailing ‘/’ when entering the URL. However,it will trigger a 301 redirect response.

In your case, if you don’t need the permenant keyword, you can modify the seafile.nginx.conf configuration file. This file is mapped from inside the Docker container to a directory on the host machine, so it’s persisted. Restarting the Docker container won’t affect your changes.

Thanks for following up!

Just to be sure: my change will persist just fine, but it might also break my setup if the original nginx config file provided by the docker container is changed in the future (e.g. Seafile 14.0) and I still have an old config file?

In that case can I just delete my modified copy and it will be regenerated?

Anyway I also found that apparently Gnome’s gvfs is to blame for the issue I was experiencing: Final / in PROPFIND is removed with query_info (#168) · Issues · GNOME / gvfs · GitLab
(gvfs is actively removing a trailing slash!)

Once the config file is mapped to host machine, it will not be regenerated after the deletion. You may not have to delete the modified copy when upgrading a new Seafile version. We will provide a complete upgrade notes in the document including the modification of varies of config files which you can follow and do the upgrading.