Nextcloud domain redirects incorrectly

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.x
What app is this about: Nextcloud 30

Describe your issue

This might not be an app problem per se, but …

Some short while ago I had to uninstall and reinstall Nextcloud. When I did so, I inadvertently set the install at cloud.mydomain.tld/nextcloud, when I’d intended it to simply be at cloud.mydomain.tld. A few days ago I “fixed” this by removing the directory and then enabling the domain root redirect.

Today, when I went to access my Nextcloud at cloud.mydomain.tld, I’m getting automatically redirected to cloud.mydomain.tld/nextcloud, and receiving a “Page not found” error page (albeit a Nextcloud-branded error page). I verified in the Yunohost admin panel that Nextcloud is set to cloud.mydomain.tld and the domain root redirect is enabled.

I’ve tried this on several browsers and devices. Not sure how to even begin troubleshooting this one.

Share relevant logs or error messages

n/a and/or forthcoming

What do you mean “removing the directory” and “enabling root redirect”?
For the first one I suppose it’s you deleted the path in the app configuration on the webadmin.

that is correct

and this one ?

the button in the webmin that says something to the effect of “redirect domain root to this app”

if that’s unclear I’ll take a screencap when i’m in front of my computer again

OK. Try resetting the redirect to default

By this do you mean, click the button that now says “make_app_not_default” ? Or restore the trailing /nextcloud to the access URL?

Here’s what I’m currently seeing:

OK, I understood. I thought you made changes on the domain config. In the webadmin > domains > your domain > default app.
Can you check the nginx config of your nextcloud?

Ahh can you be a bit more specific as to what I’m looking for? I looked over the configs when I started having trouble but nginx isn’t exactly my forte

Here’s a fun little addendum: if I set the access URL back to cloud.mydomain.tld/nextcloud, everything works again.

What’s happening, I think, is the domain root redirect is set to cloud.mydomain.tld/nextcloud, so even when I change the access URL to the domain root the redirect is apparently not updated and is still trying to access the subdir.

Unfortunately, when I try to turn off the redirect, I get an error … here’s the paste:

https://paste.yunohost.org/raw/hogexiheva

For the nginx config file it’s in /etc/nginx/conf.d/domain/nextcloud.conf
Try running a force upgrade sudo yunohost app upgrade nextcloud --force
Try also moving nextcloud to another subdomain.
If it’s a new install, just remove it and reinstall it.

Yes, I knew where the config files were, I did look through them but I’m not super clear on what I’d be looking for.

So I tried moving Nextcloud to a new subdomain (whereupon it no longer redirected but functioned as expected), deleted cloud.mydomain.tld, recreated cloud.mydomain.tld, then moved Nextcloud back … and the issue persists.

I did also try the forced upgrade, to no effect.

I looked through the nginx nextcloud.conf file and I don’t see anything about a redirect or rewrite, nor any reference to the /nextcloud subdir.

Try moving nextcloud to the /nextcloud then click on “make_app_not_default” then move it to the root domain

Oh that’s the best part – ever since doing the things I mentioned in my last post, the button has reverted from “make_app_not_default” to “Make default”.

And yet, it redirects.

So make default then make not default

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.