Some image paths use server hostname instead of no-ip address

I just today installed NextCloud 12 on my Debian Stretch system. Everything works fine. When I open NC by or https://serverHostName all the images load fine. But when I go to the site using my no-ip url then some images don’t load. Looking at the HTML the path for the images is https://serverHostName....

Any idea how to fix this? Here is an excerpt of my configuration files:


$CONFIG = array(
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' =>
  array (
    0 => '',
    1 => '',
    2 => 'serverHostName',
  'datadirectory' => '/data/nextcloud',
  'overwrite.cli.url' => '',
  'dbtype' => 'mysql',
  'version' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '***',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\ACPu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 'true',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  'htaccess.RewriteBase' => '/',
  'enable_previews' => true,
  'mail_from_address' => 'myDomain',
  'mail_smtpmode' => 'php',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => '',
  'overwritewebroot' => '/',
  'overwritehost' => '',
  'overwriteprotocol' => 'https',
  'check_for_working_htaccess' => true,
  'check_for_working_wellknown_setup' => true,
  'check_for_working_webdav' => true,
  'has_internet_connection' => true,
  'log_rotate_size' => 104857600,
  'cron_log' => true,


DefaultRuntimeDir ${APACHE_RUN_DIR}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
<Directory /usr/share>
        AllowOverride None
        Require all granted
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
AccessFileName .htaccess
<FilesMatch "^\.ht">
        Require all denied
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf


<VirtualHost *:80>
    DocumentRoot /var/www/nextcloud
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]


<IfModule mod_ssl.c>
    <VirtualHost *:443>
        DocumentRoot /var/www/nextcloud

        <Directory /var/www/nextcloud/>
            Options +FollowSymlinks
            AllowOverride All
            <IfModule mod_dav.c>
                    Dav off
            SetEnv HOME /var/www/nextcloud
            SetEnv HTTP_HOME /var/www/nextcloud
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        SSLCertificateFile /etc/letsencrypt/live/
        SSLCertificateKeyFile /etc/letsencrypt/live/
        Include /etc/letsencrypt/options-ssl-apache.conf
        Protocols h2 http/1.1
        <IfModule mod_headers.c>
                Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"

Can you remove the direct ip-address from the and try again?
Also, have a look in /etc/hosts file.

tried that but it didn’t work.

looks like i am getting the CSP error too so i will close this thread and open a new one with more details.

Exact same problem here. When receiving my activitiy-survey email, all links will be set using my internal hostname and not my
I already fiddled with my hostname and the but this didn’t work.

Any clue?