SeaDrive not working with haproxy redirect

Hi,
we are running a Seafile cluster with haproxy. Our organization has a long and a short domain, what makes problems when users authenticate to seafile.myorganization.de and then open a link that points to seafile.myorg.de.

Now we configured haproxy to redirect all requests from the short to the long domain:

acl host_short hdr(host) -i seafile.myorg.de
http-request redirect prefix https://seafile.myorganization.de code 301 if host_short

This perfectly works for webbrowser access and it also works with the Seafile client and the iOS and Android apps. Only the SeaDrive client (Windows) fails with the following errors:

[06/27/25 10:06:19] Starting SeaDrive client 3.0.15
[06/27/25 10:06:19] rpc server started.
[06/27/25 10:07:19] cache size limit is 10000000000
[06/27/25 10:09:25] adding account https://seafile.myorg.de:443 user@myorganization.de.
[06/27/25 10:09:26] Bad response code for GET https://seafile.myorg.de:443/api2/repos/: 301.
[06/27/25 10:09:26] Bad response code for GET https://seafile.myorg.de:443/seafhttp/protocol-version: 301.
....

Configuring SeaDrive with the long domain works.

Any ideas?
Dirk

Hello @uosseafile ,

You mentioned that the sync client can work — does that mean it can properly sync the library to the local machine and also upload files normally? (Not referring to the cloud file browser.)

Also, under normal circumstances, a 301 redirect should prevent the client from logging in, because the login request is a POST. After a 301 redirect, the request would be changed to a GET, which should cause login to fail.

Did you make any additional configurations to handle this? Or did you perform the redirect setup after logging in?

Hi feiniks,

good, that you asked: the sync client doesn’t work, neither. I didn’t check the synchronization, before.
If I define a new account in the sync client using the short domain, and try to sync a library to a local folder, I’m getting the following error message:

[07/02/25 13:26:01] libcurl failed to POST https://seafile.myorg.de:443/seafhttp/repo/28bddbdd-5b09-4f74-9255-9aa5d4109ab2/pack-fs/: Send failed since rewinding of the data stream failed.
[07/02/25 13:26:01] Failed to get fs objects for repo 28bddbdd on server https://seafile.myorg.de:443.
[07/02/25 13:26:01] Transfer repo '28bddbdd': ('normal', 'fs') --> ('error', 'finished')
[07/02/25 13:26:01] Transition clone state for 28bddbdd from [fetch] to [error]: Unhandled http redirect from server. Please check server cofiguration.

It doesn’t matter, if I define “code 301” in the haproxy redirect statement. Without this, haproxy uses code 302, that doesn’t work, neither.

Hello @uosseafile ,

I still have one more question: how did you log in to the client using the short domain name?

In theory, directly entering the short domain name should result in an error due to the 301 redirect.

Did you log in through Single Sign-On?

No, I can directly authenticate using the short domain. The account is registered as username@seafile.myorg.de. The sync client shows my remote libraries on the seafile server.