Err_too_many_redirects 15.0.7

Nextcloud version (eg, 12.0.2): 15.0.7
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04 LTS (Nextcloud preconfigured VM)
Apache or nginx version (eg, Apache 2.4.25): 2.4.29
PHP version (eg, 7.1): 7.4

The issue you are facing:
Whenever I try accessing Nextcloud on a freshly made vm, it gives an ERR_TOO_MANY_REDIRECTS when trying to connect.

Is this the first time you’ve seen this error? (Y/N):
N
Steps to replicate it:

  1. Install Nextcloud
  2. Access it
    The output of your Nextcloud log in Admin > Logging:
https://pastebin.com/raw/0c3q5k2e

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

<?php
$CONFIG = array (
  'passwordsalt' => 'hi',
  'secret' => 'hi',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '192.168.254.105',
    2 => 'hi',
    3 => 'hi',
  ),
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '15.0.7.0',
  'overwrite.cli.url' => 'hi',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'ncadmin',
  'dbpassword' => 'hi',
  'installed' => true,
  'instanceid' => 'hi',
  'mail_smtpmode' => 'smtp',
  'remember_login_cookie_lifetime' => '1800',
  'log_rotate_size' => '10485760',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => 'hi',
  ),
  'htaccess.RewriteBase' => '/',
  'loglevel' => '2',
  'log_type' => 'file',
  'logfile' => '/mnt/ncdata/nextcloud.log',
  'logtimezone' => 'America/Chicago',
  'enable_previews' => true,
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'maintenance' => false,
);

The output of your Apache/nginx/system log in /var/log/____:
Access log is empty, here is error log

[Tue Apr 09 16:50:37.812533 2019] [mpm_event:notice] [pid 31874:tid 140020009143232] AH00491: caught SIGTERM, shutting down
[Tue Apr 09 16:50:37.914549 2019] [:notice] [pid 729:tid 140148647807936] ModSecurity for Apache/2.9.2 (http://www.modsecurity.org/) configured.
[Tue Apr 09 16:50:37.914587 2019] [:notice] [pid 729:tid 140148647807936] ModSecurity: APR compiled version="1.6.2"; loaded version="1.6.3"
[Tue Apr 09 16:50:37.914590 2019] [:warn] [pid 729:tid 140148647807936] ModSecurity: Loaded APR do not match with compiled!
[Tue Apr 09 16:50:37.914592 2019] [:notice] [pid 729:tid 140148647807936] ModSecurity: PCRE compiled version="8.39 "; loaded version="8.39 2016-06-14"
[Tue Apr 09 16:50:37.914595 2019] [:notice] [pid 729:tid 140148647807936] ModSecurity: LUA compiled version="Lua 5.1"
[Tue Apr 09 16:50:37.914597 2019] [:notice] [pid 729:tid 140148647807936] ModSecurity: YAJL compiled version="2.1.0"
[Tue Apr 09 16:50:37.914598 2019] [:notice] [pid 729:tid 140148647807936] ModSecurity: LIBXML compiled version="2.9.4"
[Tue Apr 09 16:50:37.914623 2019] [:notice] [pid 729:tid 140148647807936] ModSecurity: StatusEngine call: "2.9.2,Apache/2.4.29 (Ubuntu),1.6.2/1.6.3,8.39/8.39 2016-06-14,Lua 5.1,2.9.4,3a097aa55f39f4dcc97f32fb527a974134588037"
[Tue Apr 09 16:50:37.990645 2019] [:notice] [pid 729:tid 140148647807936] ModSecurity: StatusEngine call successfully sent. For more information visit: http://status.modsecurity.org/
[Tue Apr 09 16:50:38.064011 2019] [mpm_event:notice] [pid 739:tid 140148647807936] AH00489: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Tue Apr 09 16:50:38.064057 2019] [core:notice] [pid 739:tid 140148647807936] AH00094: Command line: '/usr/sbin/apache2'
[Tue Apr 09 16:51:11.025857 2019] [mpm_event:notice] [pid 739:tid 140148647807936] AH00491: caught SIGTERM, shutting down
[Tue Apr 09 16:51:54.232634 2019] [:notice] [pid 2495:tid 139949634317248] ModSecurity for Apache/2.9.2 (http://www.modsecurity.org/) configured.
[Tue Apr 09 16:51:54.232667 2019] [:notice] [pid 2495:tid 139949634317248] ModSecurity: APR compiled version="1.6.2"; loaded version="1.6.3"
[Tue Apr 09 16:51:54.232670 2019] [:warn] [pid 2495:tid 139949634317248] ModSecurity: Loaded APR do not match with compiled!
[Tue Apr 09 16:51:54.232673 2019] [:notice] [pid 2495:tid 139949634317248] ModSecurity: PCRE compiled version="8.39 "; loaded version="8.39 2016-06-14"
[Tue Apr 09 16:51:54.232675 2019] [:notice] [pid 2495:tid 139949634317248] ModSecurity: LUA compiled version="Lua 5.1"
[Tue Apr 09 16:51:54.232677 2019] [:notice] [pid 2495:tid 139949634317248] ModSecurity: YAJL compiled version="2.1.0"
[Tue Apr 09 16:51:54.232679 2019] [:notice] [pid 2495:tid 139949634317248] ModSecurity: LIBXML compiled version="2.9.4"
[Tue Apr 09 16:51:54.232701 2019] [:notice] [pid 2495:tid 139949634317248] ModSecurity: StatusEngine call: "2.9.2,Apache/2.4.29 (Ubuntu),1.6.2/1.6.3,8.39/8.39 2016-06-14,Lua 5.1,2.9.4,3a097aa55f39f4dcc97f32fb527a974134588037"
[Tue Apr 09 16:51:54.305797 2019] [:notice] [pid 2495:tid 139949634317248] ModSecurity: StatusEngine call successfully sent. For more information visit: http://status.modsecurity.org/
[Tue Apr 09 16:51:54.381777 2019] [mpm_event:notice] [pid 2537:tid 139949634317248] AH00489: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Tue Apr 09 16:51:54.381810 2019] [core:notice] [pid 2537:tid 139949634317248] AH00094: Command line: '/usr/sbin/apache2'
[Tue Apr 09 16:52:31.432710 2019] [mpm_event:notice] [pid 2537:tid 139949634317248] AH00491: caught SIGTERM, shutting down
[Tue Apr 09 16:53:30.458880 2019] [:notice] [pid 1843:tid 140305614990272] ModSecurity for Apache/2.9.2 (http://www.modsecurity.org/) configured.
[Tue Apr 09 16:53:30.467827 2019] [:notice] [pid 1843:tid 140305614990272] ModSecurity: APR compiled version="1.6.2"; loaded version="1.6.3"
[Tue Apr 09 16:53:30.467843 2019] [:warn] [pid 1843:tid 140305614990272] ModSecurity: Loaded APR do not match with compiled!
[Tue Apr 09 16:53:30.467849 2019] [:notice] [pid 1843:tid 140305614990272] ModSecurity: PCRE compiled version="8.39 "; loaded version="8.39 2016-06-14"
[Tue Apr 09 16:53:30.467867 2019] [:notice] [pid 1843:tid 140305614990272] ModSecurity: LUA compiled version="Lua 5.1"
[Tue Apr 09 16:53:30.467871 2019] [:notice] [pid 1843:tid 140305614990272] ModSecurity: YAJL compiled version="2.1.0"
[Tue Apr 09 16:53:30.467874 2019] [:notice] [pid 1843:tid 140305614990272] ModSecurity: LIBXML compiled version="2.9.4"
[Tue Apr 09 16:53:30.467925 2019] [:notice] [pid 1843:tid 140305614990272] ModSecurity: StatusEngine call: "2.9.2,Apache/2.4.29 (Ubuntu),1.6.2/1.6.3,8.39/8.39 2016-06-14,Lua 5.1,2.9.4,3a097aa55f39f4dcc97f32fb527a974134588037"
[Tue Apr 09 16:53:30.598943 2019] [:notice] [pid 1843:tid 140305614990272] ModSecurity: StatusEngine call successfully sent. For more information visit: http://status.modsecurity.org/
[Tue Apr 09 16:53:30.661409 2019] [mpm_event:notice] [pid 2136:tid 140305614990272] AH00489: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Tue Apr 09 16:53:30.661440 2019] [core:notice] [pid 2136:tid 140305614990272] AH00094: Command line: '/usr/sbin/apache2'