Nextcloud powered by Kapsi Internet-users association's servers and trouble

Nextcloud version: 13.0.4
Operating system and version: Debian 8
Apache or nginx version: Apache 2
PHP version: 5.6.33-0+deb8u1

The issue you are facing:
Android client not able to sync nor list anything from the instance.

If there’s any of the Kapsi Internet-users association’s users, please share your how-to’s.

Continued from: https://github.com/nextcloud/server/issues/9594

Is this the first time you’ve seen this error?
No

Steps to replicate it:

  1. Fresh install of Nextcloud on kapsi.fi servers
  2. Tweaking the .htaccess file with:
    <Limit GET POST PUT DELETE OPTIONS PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> order deny,allow allow from all </Limit>
  3. Trying to use the android app

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "<REMOVED SENSITIVE VALUE>.samip.fi"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https://***REMOVED SENSITIVE VALUE***/cloud",
        "dbtype": "mysql",
        "version": "13.0.4.0",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false
    }
}

The output of your Apache log:

[12/Jun/2018:19:08:52 +0300] "GET /cloud/status.php HTTP/1.1" 200 146 "-" "Mozilla/5.0 (Android)ownCloud-android/3.1.0" 128665
[12/Jun/2018:19:08:52 +0300] "HEAD /cloud/remote.php/webdav/ HTTP/1.1" 401 - "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 455458
[12/Jun/2018:19:08:53 +0300] "GET /cloud/status.php HTTP/1.1" 200 146 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 95123
[12/Jun/2018:19:08:53 +0300] "HEAD /cloud/remote.php/webdav/ HTTP/1.1" 401 - "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 357398
[12/Jun/2018:19:09:12 +0300] "GET /cloud/status.php HTTP/1.1" 200 146 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 94240
[12/Jun/2018:19:09:12 +0300] "HEAD /cloud/remote.php/webdav/ HTTP/1.1" 401 - "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 366835
[12/Jun/2018:19:09:12 +0300] "HEAD /cloud/remote.php/webdav/ HTTP/1.1" 200 - "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 631420
[12/Jun/2018:19:09:13 +0300] "GET /cloud/ocs/v1.php/cloud/user?format=json HTTP/1.1" 200 391 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 700412
[12/Jun/2018:19:09:14 +0300] "GET /cloud/ocs/v1.php/cloud/capabilities?format=json HTTP/1.1" 200 539 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 722552
[12/Jun/2018:19:09:14 +0300] "GET /cloud/ocs/v1.php/cloud/capabilities?format=json HTTP/1.1" 200 539 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 1044765
[12/Jun/2018:19:09:15 +0300] "GET /cloud/ocs/v1.php/cloud/users/<username-censored>?format=json HTTP/1.1" 401 140 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 1058559
[12/Jun/2018:19:09:15 +0300] "GET /cloud/ocs/v1.php/cloud/users/<username-censored>?format=json HTTP/1.1" 401 140 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 1069396
[12/Jun/2018:19:09:16 +0300] "GET /cloud/status.php HTTP/1.1" 200 146 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 99536
[12/Jun/2018:19:09:14 +0300] "GET /cloud/ocs/v1.php/cloud/users/<username-censored>?format=json HTTP/1.1" 401 140 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 3916032
[12/Jun/2018:19:09:17 +0300] "GET /cloud/ocs/v1.php/cloud/capabilities?format=json HTTP/1.1" 200 541 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 3478874
[12/Jun/2018:19:09:14 +0300] "GET /cloud/index.php/avatar/<username-censored>/336 HTTP/1.1" 304 - "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 11024420
[12/Jun/2018:19:09:20 +0300] "GET /cloud/ocs/v1.php/cloud/user?format=json HTTP/1.1" 401 140 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 25872055
[12/Jun/2018:19:09:26 +0300] "GET /cloud/index.php/avatar/<username-censored>/336 HTTP/1.1" 304 - "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 30291143
[12/Jun/2018:19:09:14 +0300] "GET /cloud/ocs/v1.php/cloud/users/<username-censored>?format=json HTTP/1.1" 401 140 "-" "Mozilla/5.0 (Android) ownCloud-android/3.1.0" 41486475