NC19: Layout broken

The website layout of my NC instance is broken and looks like this:

Haven’t changed or updated something lately. Also I’m not using custom theme or CSS.
However, all functions appear to be still working (like webdav etc.)

The devtools of the browser put a lot of warnings al regarding some depreciated function of Jquery, don’t think this has something to do with this:

No relevant errors in apache, php mysql nor nextcloud to report.

My installation:

  • Debian 10 buster
  • PHP 7.3
  • Apache 2.4
  • MariaDB 10.3.22
  • Nextcloud 19.0

My config.php

“system”: {
“passwordsalt”: “REMOVED SENSITIVE VALUE”,
“trusted_domains”: [
“datadirectory”: “REMOVED SENSITIVE VALUE”,
“overwrite.cli.url”: “”,
“htaccess.RewriteBase”: “/”,
“dbtype”: “mysql”,
“version”: “”,
“dbport”: “”,
“dbtableprefix”: “oc_”,
“installed”: true,
“mail_from_address”: “REMOVED SENSITIVE VALUE”,
“mail_smtpmode”: “smtp”,
“mail_smtpauthtype”: “LOGIN”,
“mail_smtpauth”: 1,
“mail_smtphost”: “REMOVED SENSITIVE VALUE”,
“”: “stable”,
“maintenance”: false,
“theme”: “”,
“filelocking.enabled”: true,
“loglevel”: 2,
“mail_smtpsecure”: “ssl”,
“mail_smtpname”: “REMOVED SENSITIVE VALUE”,
“mail_smtppassword”: “REMOVED SENSITIVE VALUE”,
“mail_smtpport”: “465”,
“data-fingerprint”: “474464e13b9101e01b419b3fd16403d2”,
“enable_previews”: true,
“filesystem_check_changes”: 1,
“has_rebuilt_cache”: true,
“mysql.utf8mb4”: true,
“memcache.local”: “\OC\Memcache\APCu”,
“app_install_overwrite”: [
“onlyoffice”: {

What could be the cause of this problem?


Please change in second screenshot to “network” and look if there are http-requests with not-200 e.g. 404 - file not found. I think the js-errors are normal. I also get errors with jQuery.

please find updated screenshot with the network traffice. To 4xx errors like missing css or alike.

I think there is no 404. But there are cached objects.
Can you test another browser? Can you delete the cache? Can you use inkognito modus?
Same error in all environments?

You’re right - I’ve deleted the cache and now I’m getting lot of CSP errors:

Here you have the relevant http headers:
(I’ve left the recommended defaults untouched)

  • .htaccess
# Add security and privacy related headers
# Avoid doubled headers by unsetting headers in "onsuccess" table,
# then add headers to "always" table:
Header onsuccess unset Referrer-Policy
Header always set Referrer-Policy "no-referrer"

Header onsuccess unset X-Content-Type-Options
Header always set X-Content-Type-Options "nosniff"

Header onsuccess unset X-Download-Options
Header always set X-Download-Options "noopen"

Header onsuccess unset X-Frame-Options
Header always set X-Frame-Options "SAMEORIGIN"

Header onsuccess unset X-Permitted-Cross-Domain-Policies
Header always set X-Permitted-Cross-Domain-Policies "none"

Header onsuccess unset X-Robots-Tag
Header always set X-Robots-Tag "none"

Header onsuccess unset X-XSS-Protection
Header always set X-XSS-Protection "1; mode=block"
SetEnv modHeadersAvailable true
  • Apache Vhost

      <IfModule mod_ssl.c>
              <VirtualHost *:443>
      <IfModule mod_headers.c>
            Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
                      SSLEngine on
                      SSLCertificateFile      /etc/letsencrypt/live/
                      SSLCertificateKeyFile /etc/letsencrypt/live/
              # enable HTTP/2, if available
              Protocols h2 http/1.1
      # intermediate configuration, tweak to your needs
      SSLProtocol             all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
      SSLHonorCipherOrder     on
      SSLSessionTickets       off
                      <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                      SSLOptions +StdEnvVars
                      <Directory /usr/lib/cgi-bin>
                                      SSLOptions +StdEnvVars
      <Directory "/var/www/html/">
        Require all granted
        AllowOverride All
        Options FollowSymLinks MultiViews
      SSLUseStapling On
      SSLStaplingCache "shmcb:logs/ssl_stapling(32768)"

These CSP errors only appear when using Firefox. Could be a bug related to this browser as this github issue states.
I’ve used a chromium (after wiping cache etc.) and got the same network trafic as in the first screenshot.

Perhaps you can search the help forum of nextcloud and find something about CSP errors.

An example:

Surely a basic setting for any experienced Nextcloud / php dev.
I have setted the “overwriteprotocol” system param to “https” by running the following docker command : docker exec --user www-data 3ded238a522a /var/www/html/occ config:system:set “overwriteprotocol” --value “https” .

CSP error during login from NextCloud Windows

Looks like the scss was not compiled correctly. Try a occ maintenance:repair to clear the caches. This helps sometimes.

I’ve executed the occ maintenance:repair command and now the layout is fine again! I did have to clear the cache from the browser before it was working.

Thanks for your help!

1 Like