Nextcloud Infinite Spinner
Documentation: Nextcloud “Infinite Spinner” Login Fix
Issue: When logging into Nextcloud via a Cloudflare Tunnel (especially on high-latency networks like public Wi-Fi), the login spinner persists indefinitely even though the authentication is successful. A second tab shows the user is already logged in.
Root Cause: Nextcloud is unaware it is behind a reverse proxy. It receives a request from a local IP (the tunnel) but expects a direct connection. This causes a mismatch in the redirect headers, preventing the “Login Success” signal from triggering the browser redirect.
Solution: Proxy Configuration
Modify your config.php to include the following parameters. This tells Nextcloud to trust the incoming proxy headers and forces it to use HTTPS for all generated URLs.
'trusted\_proxies' => ['127.0.0.1', '::1'],
'overwritehost' => 'your.nextcloud.domain.com',
'overwriteprotocol' => 'https',
'overwritewebroot' => '',
'overwrite.cli.url' => 'https://your.nextcloud.domain.com',Key Parameters Explained
- trusted_proxies: Prevents Nextcloud from ignoring the headers sent by the Cloudflare tunnel.
- overwriteprotocol: Forces https, preventing the “Mixed Content” errors that often stall the login script.
- overwritehost: Ensures that even if the internal network uses a different hostname, the external URL remains consistent.