How to fix Nextcloud refusing to log in to apps

Hi! If you're like me and use Nextcloud through a reverse proxy, sometimes it will just act dumb and refuse to log in to apps, either opening a pop-up that says something along the lines of "Strict mode: no HTTP allowed!", or just hangs on a spinning animation.

That's because it thinks you're using HTTP to access it, when your reverse proxy is actually securing it.

That's why you need to set a config parameter to make it use HTTPS for links, even though it thinks it's serving over HTTP.

If you use NixOS, like I do, then that option is services.nextcloud.config.overwriteProtocol = "https";. In the regular nextcloud config.php, that option is just overwriteprotocol = "https";.

I hope this handcrafted page helped you!