Webdav frequent 502 error

Hello,

I set up seafile in a quite complex network:

Internet – Server A(https) – Nginx reverse proxy – Server B(http) – Seafile (docker version)

The Server B does not have a public IP, so it is in a same tailscale network with Server A. Server A is in US and Server A is in China

I’m using Zotero and set it to sync the attachments to the seafile via webdav, however the PUT command issued by zotero has a high chance to fail with a 502 response. While there are cases the upload is successful. The Nginx server gives no meaningful logs. The seafile server log (seafdav.error.log) says this:

writev() failed (104: Connection reset by peer) while sending request to upstream

I’ve set up a immich server in the Server B too and it works fine. So I guess I’ve done something wrong with the config?

I suggest you to simplify your network setup. Otherwise it is hard to find the cause of the issue.

Thanks!

Update: Now I believe there is some compatible issue between v2ray, proxifier and zotero. Seafile and seafdav is fine.

Update2: Using other proxy softwares have no help. Direct connection have ~30% 502 chance, reducing max upload thread to 1 in zotero eliminates all 502 error.