Preview and creation document broken / csp policy problem

Hello everyone,
I’m having a problem opening documents, whether .docx or .odt.
When I try to open it I get an error like the one below, despite several attempts it persists.
2023-10-03_11h36_40

I then did "inspect the element and I see an error that says:

Refused to create a worker from 'https://nas.****.cloud/index.php/apps/files/preview-service-worker.js' because it violates the following Content Security Policy directive: "script-src 'nonce-UDQvclREbURZMis2M0MzTHRQZk5BMlNNbGQ5OTlOL2s1Wm55ME90S21GND06VWVhQ0FYdktPbGJaakhTTi9MU0NUUURDNTVNU2dxdStpTEtnbFprSHdndz0='". Note that 'worker-src' was not explicitly set, so 'script-src' is used as a fallback.
(anonymous) @ ServiceWorker.js:31

My config :

  • Nextcloud is installed on an OS trunas scale: TrueNAS-SCALE-22.12.3.3
  • Nextcloud is version 27.1.1_1.6.49 from the official truenas repository.
  • Config.php :
<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'enable_previews' => true,
  'enabledPreviewProviders' => [
        'OC\Preview\BMP',
        'OC\Preview\GIF',
        'OC\Preview\JPEG',
        'OC\Preview\Krita',
        'OC\Preview\MarkDown',
        'OC\Preview\MP3',
        'OC\Preview\MP4',
        'OC\Preview\OpenDocument',
        'OC\Preview\PNG',
        'OC\Preview\TXT',
        'OC\Preview\XBitmap',
   ],

  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'passwordsalt' => '********',
  'secret' => '**********',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '192.168.1.***',
    2 => '*****.cloud',
    3 => 'nas.*****.cloud',
    4 => 'https://nas.******.cloud',
  ),
  'datadirectory' => '/var/www/html/data',
  'content_security_policy' => '',
  'dbtype' => 'pgsql',
  'version' => '27.1.1.0',
  'overwrite.cli.url' => 'https://nas.*****.cloud',
  'overwritehost' => 'nas.*****.cloud',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextcloud-postgres:5432',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin',
  'dbpassword' => '************',
  'installed' => true,
  'instanceid' => 'oc53alwb4oj9',
);

This nextcloud is accessible through a cloudflare tunnel configured nas.XXXX.cloud → http://192.168.1.XXX:9001

I have tried a lot of solution desactivate some option like tls verify in cloudflare stuff like that but the problem persist.

If you have any hintwho can help me I will be grateful to you

Thanks in advance
Thomas