Nextcloud domain isn't working, but I can access through public IP address

I added the domain I recently purchased with easyDNS (and managed by Cloudflare) to the trusted list. I made sure that the http and https ports are opened up, and can access the server with my public IP (which I just removed).

Type Name Content
A yamiyukisenpai.tech {public IP}
CNAME easydns motorhead.easydns.org
CNAME www yamiyukisenpai.tech
MX yamiyukisenpai.tech mx-caprica.easydns.com

$ snap run nextcloud.occ config:system:get trusted_domains 
192.168.100.6
yamiyukisenpai.tech

What am I doing wrong exactly?

Based on the error, Iā€™d say thereā€™s an issue with the web server configuration. Can you post that?

Since it says too many redirects, it sounds like itā€™s making the connection, so the DNS is probably fine.

<?php
$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' => 
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'instanceid' => <secret>,
  'passwordsalt' => <secret>,
  'secret' => <secret>,
  'trusted_domains' => 
  array (
    0 => '192.168.100.6',
    1 => 'yamiyukisenpai.tech',
  ),
  'datadirectory' => '/media/DATA/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '15.0.11.1',
  'overwrite.cli.url' => 'http://192.168.100.6',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => <dbpassword>,
  'installed' => true,
  'maintenance' => false,
);

Just wondering, was there supposed to be a closing PHP tag?

Thatā€™s your Nextcloud configuration. I think your issue is going to be with the web server configuration. I think the snap uses Apache for the web server.

What would the file name be?

The /var/snap/nextcloud/curruent/apache directory only has logs.

Iā€™m really not too sure about the snap version. When I found out the limitations of the snap version and had a bunch of trouble with Collabora, I switched to Docker.

I found this thread that seems to have some info. https://help.nextcloud.com/t/snap-installation-change-php-apache-and-nextcloud-configs/32858/2

did you try: 'overwrite.cli.url' => 'http://yamiyukisenpai.tech',

Yup.

I also read that it might be the time & date setting, which I fixed, but that didnā€™t help.

Posted a bug report on GitHub. Hopefully this gets solved soon.

Got it to work.

Had to change the SSL settings in Cloudflare to ā€œfullā€ from ā€œmediumā€