Nextcloud Infinite Logging In via locally, but works fine with external domain

Hi all,

I have installed nextcloud in docker. I am using the built-in SQLite, because configuring to MariaDB was another hectic story.

Coming back, I am using localtunnel (Reverse Proxy) to expose it to internet.

From Browser, I am able to access it both locally and remote and successfully login.

When I try to login with Android Client, I get ‘Strict mode : HTTP’ error. So, I have added the following to my config.php

'overwriteprotocol' => 'https',

Later, in Android Client, I am able to access it remotely (that is via internet), but not locally.

When I try to login locally,

  1. I enter local IP with Port
  2. I accept to grant access to nextcloud
  3. I enter my credentials and click login
  4. Infinite login

I was expecting it to redirect me to dashboard, but it did not.

EDIT 1 : I found that now I am not able to login locally on both Android and Browser. I am able to see login screen, but logining in infinitely.

EDIT 2 : Added more details to debug

## Server configuration detail

**Operating system:** Linux 5.13.0-1010-raspi #12-Ubuntu SMP PREEMPT Tue Nov 9 15:30:22 UTC 2021 aarch64

**Webserver:** Apache/2.4.51 (Debian) (apache2handler)

**Database:** sqlite3 3.34.1

**PHP version:** 8.0.12

Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, pdo_sqlite, session, posix, Reflection, standard, SimpleXML, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, bcmath, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache

**Nextcloud version:** 22.2.3 - 22.2.3.0

**Updated from an older Nextcloud/ownCloud or fresh install:**

**Where did you install Nextcloud from:** unknown

<details><summary>Signing status</summary>

Array ( )

</details>

<details><summary>List of activated apps</summary>


Enabled:
 - accessibility: 1.8.0
 - activity: 2.15.0
 - bruteforcesettings: 2.2.0
 - calendar: 2.3.4
 - circles: 22.1.1
 - cloud_federation_api: 1.5.0
 - comments: 1.12.0
 - contacts: 4.0.6
 - contactsinteraction: 1.3.0
 - dashboard: 7.2.0
 - dav: 1.19.0
 - federatedfilesharing: 1.12.0
 - federation: 1.12.0
 - files: 1.17.0
 - files_pdfviewer: 2.3.1
 - files_rightclick: 1.1.0
 - files_sharing: 1.14.0
 - files_trashbin: 1.12.0
 - files_versions: 1.15.0
 - files_videoplayer: 1.11.0
 - firstrunwizard: 2.11.0
 - logreader: 2.7.0
 - lookup_server_connector: 1.10.0
 - mail: 1.10.5
 - nextcloud_announcements: 1.11.0
 - notifications: 2.10.1
 - oauth2: 1.10.0
 - password_policy: 1.12.0
 - photos: 1.4.0
 - privacy: 1.6.0
 - provisioning_api: 1.12.0
 - recommendations: 1.1.0
 - richdocuments: 4.2.3
 - serverinfo: 1.12.0
 - settings: 1.4.0
 - sharebymail: 1.12.0
 - spreed: 12.1.2
 - support: 1.5.0
 - survey_client: 1.10.0
 - systemtags: 1.12.0
 - text: 3.3.0
 - theming: 1.13.0
 - twofactor_backupcodes: 1.11.0
 - updatenotification: 1.12.0
 - user_status: 1.2.0
 - viewer: 1.6.0
 - weather_status: 1.2.0
 - workflowengine: 2.4.0
Disabled:
 - admin_audit
 - encryption
 - files_external
 - richdocumentscode
 - user_ldap

</details>

<details><summary>Configuration (config/config.php)</summary>

{
    "htaccess.RewriteBase": "\/",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "apps_paths": [
        {
            "path": "\/var\/www\/html\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/www\/html\/custom_apps",
            "url": "\/custom_apps",
            "writable": true
        }
    ],
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "192.168.29.79:9001",
        "example.loca.lt"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "sqlite3",
    "version": "22.2.3.0",
    "overwrite.cli.url": "http:\/\/192.168.29.79:9001",
    "installed": true
}

</details>

**External storages:** files_external is disabled

**Encryption:** no

**User-backends:**

* OC\User\Database

**Talk configuration:**

STUN servers

* no custom server configured

TURN servers

* no custom server configured

Signaling servers (mode: internal):

* no custom server configured

**Browser:** Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36

Kindly assist me on the same.