NextCloud, Too Many Redirects

panzerscope

Contributor
Joined
May 30, 2022
Messages
146
Hello all,

So this is a well known topic as I have the dreaded "Too many redirects" error when browsing to my nextcloud domain, via Traefik reverse proxy. I have read up on what it could be and the below seems like a likely culprit,

@ChrisChros I have a work around. I figured it out after my message to you. You need to edit /usr/local/etc/nginx/conf.d/nextcloud.conf within the jail. Comment out the entire Redirect to HTTPS server directive - all the lines. Go down to the next server directive for port 443. Comment out the line that says "listen 443 ssl http2;" Below that line add "listen 80 default_server;" Next go down to the line that starts with "add_header Strict-Transport-Security...." and comment it out. Save the file. Restart nginx inside the jail with the command "service nginx restart". You may see a few warning messages about https. Should be fine since you're not using it. Check logging it nextcloud now via your reverse proxy. It should work. Below is the output of how my nextcloud.conf file works. Lastly - I did hear that these changes may not persist after a jail reboot and you'll need to apply them again. You might want to make a spare copy of these changes.

Taken from another topic here: https://www.truenas.com/community/threads/disable-https-in-nextcloud-plugin.99791/

I have been trying to locate the nextcloud.conf. However the above location is based on a Jail installation as apposed to a Docker one on TrueNas Scale, so I am wondering if the nextcloud.conf is in a different location on docker?

It is worth noting I am using Shell within the application itself and selecting the nextcloud container, so I believe I am in the right place.

Furthermore, if someone who has fixed this issue has a decent how to, that would be great or if to point me in the right direction if I am barking up the wrong tree.

Thanks,
P
 
Last edited:

panzerscope

Contributor
Joined
May 30, 2022
Messages
146
Ok, so I seemed to have possibly solved this. It seems that if you have your DNS covered by a proxy...it causes this error to flag up. I am using Cloudflare and I had proxy enabled on the DNS record.

Ideally I would have liked the DNS to be proxied, but this seems to be a quick fix.

Saying that however, is there a way to allow the DNS to remain on a proxy by altering the Nextcloud or Traefik configuration ?
 
Top