Cannot connect to WebDav

Hello. I’m trying to setup Webdav on docker Seafile 11 community version,

I followed this guide > manual seafile com extension webdav

  • I can acess webdav webpage via http 127.0.0.1:8080/seafdav
  • I can access webdav webpage via my https domain

It asks me for the password and I can enter.

Then, I try to connect to https drive . redacted . com / seafdav as client

image

I get “HTTP Error: Not authorized”.

If I try to connect an android client to sync images It fails and adds some garbage files instead (ttxpart extension)

this is the seafdav.access.log

.....
192.168.1.1 172.26.0.1 [26/May/2024:00:15:19 +0000] "PUT /seafdav/Test/20240127_173836.mp4~ttxpart~ HTTP/1.1" 201 372 "-" "Mozilla/5.0 (Android) Nextcloud-android" 0.320
192.168.1.1 172.26.0.1 [26/May/2024:00:15:19 +0000] "DELETE /seafdav/Test/20240127_173836.mp4 HTTP/1.1" 404 405 "-" "Mozilla/5.0 (Android) Nextcloud-android" 0.009
192.168.1.1 172.26.0.1 [26/May/2024:00:15:19 +0000] "HEAD /seafdav/Test/20240127_173836.mp4 HTTP/1.1" 404 0 "-" "Mozilla/5.0 (Android) Nextcloud-android" 0.021
192.168.1.1 172.26.0.1 [26/May/2024:00:15:19 +0000] "MOVE /seafdav/Test/20240127_173836.mp4~ttxpart~ HTTP/1.1" 502 588 "-" "Mozilla/5.0 (Android) Nextcloud-android" 0.027
192.168.1.1 172.26.0.1 [26/May/2024:00:15:27 +0000] "PUT /seafdav/Test/20240424_181151.mp4~ttxpart~ HTTP/1.1" 201 372 "-" "Mozilla/5.0 (Android) Nextcloud-android" 0.343
192.168.1.1 172.26.0.1 [26/May/2024:00:15:28 +0000] "DELETE /seafdav/Test/20240424_181151.mp4 HTTP/1.1" 404 405 "-" "Mozilla/5.0 (Android) Nextcloud-android" 0.009
192.168.1.1 172.26.0.1 [26/May/2024:00:15:28 +0000] "HEAD /seafdav/Test/20240424_181151.mp4 HTTP/1.1" 404 0 "-" "Mozilla/5.0 (Android) Nextcloud-android" 0.015
192.168.1.1 172.26.0.1 [26/May/2024:00:15:28 +0000] "MOVE /seafdav/Test/20240424_181151.mp4~ttxpart~ HTTP/1.1" 502 588 "-" "Mozilla/5.0 (Android) Nextcloud-android" 0.028
.....

docker-compose.yml (part of it)

  seafile:
    image: seafileltd/seafile-mc:11.0-latest
    container_name: seafile
    restart: always
    ports:
      - "8000:80"
      # - "8080:8080"
      - "4438:443"  # If https is enabled, cancel the comment.

seafile.nginx.conf (part of it, the most relevant data)

# -*- mode: nginx -*-
# Auto generated at 05/25/2024 22:51:22
server {
listen 80;
server_name drive.redacted.com;

    client_max_body_size 10m;

    location / {
        proxy_pass http://127.0.0.1:8000/;
        proxy_read_timeout 310s;
        proxy_set_header Host $http_host;
        proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Connection "";
        proxy_http_version 1.1;

        client_max_body_size 0;
        access_log      /var/log/nginx/seahub.access.log seafileformat;
        error_log       /var/log/nginx/seahub.error.log;
    }

    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        client_max_body_size 0;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_request_buffering off;
        access_log      /var/log/nginx/seafhttp.access.log seafileformat;
        error_log       /var/log/nginx/seafhttp.error.log;
    }

    location /seafdav {
        proxy_pass         http://127.0.0.1:8080/seafdav;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_read_timeout  1200s;
        client_max_body_size 0;
        access_log      /var/log/nginx/seafdav.access.log seafileformat;
        error_log       /var/log/nginx/seafdav.error.log;
    }


}

seafdav.conf


[WEBDAV]
enabled = true
port = 8080
fastcgi = false
share_name = /seafdav
workers = 5
timeout = 1200

Apart from this config, I also have an apache server installed in my server which has a https configuration. I’m unsure if this configuration should be done also for webdav, as I expect to be covered by nginx


<VirtualHost *:443>
	
	ServerName drive.redacted.com
	ServerAlias drive.redacted.com

	SSLEngine On

	<Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http 127.0.0.1:8000/
    ProxyPassReverse / http 127.0.0.1:8000/

    ErrorLog /var/www/error.log
	CustomLog /var/www/access.log combined
	
	SSLProxyEngine On
	SSLProxyVerify none
	SSLProxyCheckPeerCN off
	SSLProxyCheckPeerName off
	SSLProxyCheckPeerExpire off
	ProxyPreserveHost on

    SSLCertificateFile /etc/pki/tls/certs/redacted.com_ssl_certificate.cer
	SSLCertificateKeyFile <privatekey>
	SSLCertificateChainFile <chain>
	
	
</VirtualHost>

I’m completely lost. I’m following the readme. Tested lot of configurations from folks having the same trouble, still I just cannot connect

The weird part is that I an access the webdav fileserver from the browser. I just cannot connect to it through other applications. This was working perfectly for me in v8. But I renewed my server and started fresh

Many thanks!

PS: I had to remove all the links because this forum prevents letting you send urls, ignore any possible syntax error from urls

Isn’t it Folder

/seafdav

in the client if you use the standard setup?

Not sure what’s the standard setup, but I’m destroying the docker containers and recreating them sometimes. I did not configure anything apart from the user and password. I just followed the docker config and the seafdav config provided.

Everything works in my server. I can access hub via https://. Clients do work, cert seems to be valid. Seafile clients do sync correcttly. It’s just the webdav thing that fails to connect

Today I found something interesting:

  • I can sync files with FileSync (famous android software)
  • I cannot sync files with autosync (android too)
  • I cannot connect via nautilus/gnome webdav client

Something is messing the response and it seems FileSync seems to accept it somehow, but not other webdav clients

I have a APACHE config with 443 port set to “drive (dot) redacted (dot) com” sending the cert so the handshake seems to be ok, but I’m unsure if the nginx setup is valid

I spend a lot of time trying with version 10 instead, but I see the same errors

I can connect seafdav via http. But in HTTPS I get erros like “502 BAD GATEWAY” when trying to use the MOVE command. It seems I can connect now, and create folders, but not rename them or copying them or adding new files

I’m completely clueless right now. Tested several configurations like some configurations found here Seafdav - MOVE command causing 502 - #53 by lcx

Weird thing. I managed to send files via https:// just one time with the android. I thought I fixed it but no, after the second time it just continued giving me errors. Not sure if this is relevant or if it just was a matter of the client trying to connect via http instead of https, which works. But it worked