Nextcloud Photos returning 403

Nextcloud version: 22.2.3
Operating system and version: Debian 10
Apache or nginx version: Apache 2.4
PHP version: 7.4
Database: MySQL 10.3.31

Nextcloud Photos gives an error message “An error occured” and when looking at network traffic, there is a 403 response.
lymac

Config.php: (removed all domains and passwords)

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => 'cloud',
  ),
  'datadirectory' => '/siilo/10/mh/sites/cloud/www/data',
  'dbtype' => 'mysql',
  'version' => '22.2.3.0',
  'overwrite.cli.url' => 'https://cloud',
  'dbname' => 'mh',
  'dbhost' => 'db1',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'mh',
  'dbpassword' => '',
  'installed' => true,
  'auth.webauthn.enabled' => false,
  'filesystem_check_changes' => 1,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
);

Couldn’t find any relevant information in either Apache or Nextcloud logs.

This information might help to check the access forbidden error:

https://www.hostinger.com/tutorials/what-is-403-forbidden-error-and-how-to-fix-it