Hi. I’m currently running NC as a subdirectory of a host (host.tld/nextcloud). We now need to move it to another location on a dedicated hostname (nextcloud.host.tld), and we’d like to keep working both the urls.
In the trusted_domains params we added the urls, now I need to figure out how to proxy requests from the old host (running nginx) to the new installation.
and works for the html part, but all the other elements (js, css…) return 404 because they’re attempted on the / of host.tld. I.e. an image is loaded as host.tld/a.jpg instead of host.tld/nextcloud/a.jpg.
Yes with the webroot-setting, that is a global setting, so you can either run Nextcloud in a subfolder or not, but not both. But it would be possible to run it on two different subdomains at the same time.
A second installation with the same settings except for the subfolder in the URL, not sur, it could work. Perhaps with the session handling could get a problem.
Do you need both accesses? You can normally create a permanent redirect, the clients should then update the URL. And for old shared links, you can keep the redirect.
Exactly. In the desktop client, the feature was implemented: Save the new URL when hitting a permanent redirection 301 · Issue #5972 · owncloud/client · GitHub and I used it some time ago to change a URL.
For the mobile clients, I can’t remember. Check out the code or bugtracker, or test it, either on a test setup or only sending the permanent redirects to specific clients of your that you test it with.
I thought it is working without re-authentication. For me it was within the same domain, so perhaps if the domain changes, something with the session management might no be valid any more. But that is just a guess, I don’t really know how to verify this…
I must say I did the test on two separate NC installations, so I logged in on the current one on the old host, switched the proxy and then I was headed on an old cloned version, so it could be that.