Switch domain while old remains functional

New challenge, can Seafile handle it?

I need to switch the Seafile domain while the old domain needs to remain functional for links (redirects) and client connections, not Seahub.

I think I know how to achieve this nginx config wise but has anybody experience with this?

@shoeper Can Seafile handle the redirects?
One needs to set the Seahub domain for links and client config?

My current approach would be to have another nginx config for the new domain while the old one redirects its Seahub, Media, SeaDAV and generated links to the new domain, keeping the Seafile sync and webdav working for the clients.

Once we got thIs working the info will make its way into the community manual. :slight_smile:

1 Like

What about a CNAME Record?

What about it? For now this has nothing to do with DNS records. They are an requirement and have nothing to do with what I am asking since this is mostly about how Seafile/Seahub works with multiple domains for a switch (not multi-tenancy). :slight_smile:

I just wanted to provide a solution. So your ideas are related to this:

Mh, never thought about that.
I don’t really need a live backup I think, since the server should be available on the new domain while still working on the old one (except Seahub). So one server.

I’m using on one my Seafile instance two domains but never had time to check how it works.
But it’s little different I’m just using the old one as primary and second is just toy cause a got good price for *.cloud TLD.

EDIT: What I see. Share links working on both domains. File sync over client seems working to. So if you let old domain as it and setup new one like the old one, then change domain in settings(if you want to show share link, it’s fill domain from settings not the one from you come to seahub). If you want to, I can do some test for you like tell me what I should try.

EDIT 2: I didn’t see in database any absolute links. All what I saw were relative without domain, so all generated links should work with both domains.


The answer I was looking for, thank you. Will try and report.

Switched now, Almost spend 30min on finding why the page won’t load with the new setting.
Both host names have to be configured in the seahub_settings.py.

ALLOWED_HOSTS = ['domain1.com','domain2.com']

Now I would like to redirect Seahub to the new domain but want to make sure that clients keep working with the old domain.

On which URL location does the Seafile client require to work?

location /
location /seafhttp

This should only be necessary if you were using this option. If not, it should work with both out of the box.

I would think that you can redirect the / but not the /seafhttp, but i would test both.

1 Like

Just what I was thinking. But I cannot really test that without a test reverse proxy and some fiddeling with my local hosts file. :joy:

Just wanted to know if someone knows so I don’t have to spend time testing.
@shoeper maybe you know the answer?

It seems the client requires the location / and not just the /seafhttp.
So apperently the client doesn’t follow a redirect, since it is unable to connect if there is a redirect configured.

What ‘user agent’ does the Seafile client use?
Based on that a redirect could be excluded if the Seafile Client agent hits the Nginx server.

1 Like

Hi all,
just wanted to drop this here, I’ve the same problem:

Take care of the other clients, too, when testing.
And - if you got it working somehow, please tell us how :smiley:


@daniel.pan can you please shine some light into the darkness? Please see our questions above.

Can you try use the client’s change server address feature? It is in “Click avatar -> account settings -> server address”.

1 Like

This works, using this already. But the questions are about several other things surrounding this.
Please read the full thread to find our questions.


1 Like

This fixed my issue. I migrate domains and couldn’t figure out why the PDF viewer and other things were failing, even though I updated the Nginx config and stuff.

I forgot this setting. Thank you!