Fix Next-Cloud

The logs show that Nextcloud is blocking its own images because of a Content Security Policy (CSP) rule mismatch. Your browser is trying to load images from http://doc.gretchbaby.com, but the server safety rules only allow images from http://cloud.gretchbaby.com.This usually happens when your primary Nextcloud domain is cloud.gretchbaby.com, but your office editor app (like Collabora or ONLYOFFICE) is running on doc.gretchbaby.com and trying to cross-load assets over unencrypted HTTP.

The Underlying Issue

  • Mixed Content & CSP: Your main Nextcloud site expects everything to match its primary web address. When the document viewer tries to pull icons from the doc. subdomain, Nextcloud blocks them for safety.
  • HTTP vs HTTPS: The logs show links starting with http://. Modern browsers and Nextcloud integrations will fail or hang completely if they are not using secure https:// links.

How to Fix It

To fix the slow loading and clear these errors, you need to update your server configuration files.

1. Add the Domain to config.php

You must tell Nextcloud to trust and allow images from your document server subdomain.

  • Open your Nextcloud config/config.php file on your server.
  • Look for the 'content_security_policy' section. If it does not exist, you can add an allowed domains list.
  • Add your document domain to the image sources rule:
'content_security_policy' => [
    'img-src' => "'self' data: blob: https://*.tile.openstreetmap.org http://cloud.gretchbaby.com http://doc.gretchbaby.com",
],

Because your site is using http://, the office app integration will often time out or refuse to connect securely. You should force Nextcloud to recognize its web address properly.

  • In the same config.php file, verify or add these lines to fix the protocol:
'overwritehost' => 'cloud.gretchbaby.com',
'overwriteprotocol' => 'https',
'overwrite.cli.url' => 'https://gretchbaby.com',

(Note: Change https to http only if you do not use SSL certificates, though SSL is highly recommended to fix office loading issues).

3. Update the Office App Settings

  • Log into Nextcloud as an administrator.
  • Go to Administration settings -> Nextcloud Office (or ONLYOFFICE).
  • Make sure the server URL listed there matches exactly how you access it (e.g., http://doc.gretchbaby.com or https://gretchbaby.com).

To help give you the exact steps to apply these edits, please tell me:

  • Are you running Nextcloud via Docker / Portainer, Nextcloud AIO, or a standard Linux install (Ubuntu/Apache/Nginx)?
  • Do you have SSL certificates (HTTPS) set up for both cloud.gretchbaby.com and doc.gretchbaby.com?
  • Do you use a reverse proxy like Nginx Proxy Manager, Traefik, or Cloudflare?