Client only logs in first time

Same as this post (Only the first login is successful with owncloud client on Ubuntu 16.04)

Everything works the first time but after that the 2nd time it connects I get "no connection to Nextcloud at ". This happened with the owncloud client after I migrated to Nextcloud. Then I installed nextcloud client in Windows and Ubuntu 16.04 and same thing. I am having problems it seems all over the place with apps. Android News and NextCloud apps wont’ sign in. The website works fine. I haven’t tried a OSX client yet.

Any ideas? This is a fresh client install.

I should mention I am passing through IIS ARR/rewrite. But when I was on owncloud it was the same setup. The only difference is I am using SNI now.

Edit: SNI doesn’t make a difference.

In doing some testing/tracing it seems I am getting timeouts. Nothing to do with IIS. Setting it longer in ARR in IIS I was able to login with the Android News apps. The desktop client gives up too fast for it to be the same problem. It’s like it doesn’t even try. Hmm? So I need to figure out why the timeouts. Maybe it is related. Anyone know how to troubleshoot that in Apache? I am using the Nextcloud VM.
The Nextcloud Android app doesn’t login at all.

Well I am stumped if I connect directly internally to the Nextcloud server it is fine and snappy. I am seeing 401’s though from IIS trace and apache logs which doesn’t make sense. So I don’t know what is going on.

For future reference if anyone runs into this issue. It seems IIS ARR rewrite doesn’t play well with Nextcloud but does with OwnCloud. Not sure what is different. There is some kind of timeout. My solution was to have Nextcloud internet facing and pass traffic to IIS. It solved some other issues too, so it worked out nicely. I still wish I could figure out why it wouldn’t work with IIS. Oh well, spent enough time on this.