Nextcloud broken after adding mime types (js mjs)

Server Management: Plesk Obsidian v18.0.60
Nextcloud version (eg, 20.0.5): 28.0.3
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04.6
Apache or nginx version (eg, Apache 2.4.25): nginx/1.24.0
PHP version (eg, 7.4): 8.1.28

The issue you are facing:
after adding

	types {
		text/javascript js mjs;
		application/javascript js mjs;

under

location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ {

the instance looks weird.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Adding mjs in Plesk Additional nginx directives
  2. wait a little bit
  3. reload the site of NC

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '',
    2 => '',
  ),
  'datadirectory' => '/',
  'dbtype' => 'mysql',
  'version' => '28.0.3.2',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud_3',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncuser_',
  'dbpassword' => '',
  'installed' => true,
  'instanceid' => '',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_from_address' => '',
  'mail_domain' => '',
  'mail_smtphost' => '',
  'mail_smtpport' => '465',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'default_phone_region' => 'DE',
  'maintenance_window_start' => 1,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => ,
  ),
  'defaultapp' => '',
  'maintenance' => false,
  'theme' => '',
  'log_type' => 'file',
  'logfile' => 'cloud.log',
  'loglevel' => 3,
  'logdateformat' => 'F d, Y H:i:s',
  'log.condition' => 
  array (
    'apps' => 
    array (
      0 => 'admin_audit',
    ),
  ),
  'logfile_audit' => 'nextcloud/cloud.log',
);

The output of your Apache/nginx/system log in /var/log/____:

2024/05/07 20:52:37 [warn] 385613#0: duplicate extension "js", content type: "application/javascript", previous content type: "text/javascript" in /conf/vhost_nginx.conf:132
2024/05/07 20:52:37 [warn] 385613#0: duplicate extension "mjs", content type: "application/javascript", previous content type: "text/javascript" in /conf/vhost_nginx.conf:132
2024/05/07 20:55:01 [error] 385622#0: *16819 open() "/usr/share/html/apps/richdocumentscode/proxy.php" failed (2: No such file or directory), client: 127.0.0.1, server: server.local, request: "GET /apps/richdocumentscode/proxy.php?req=/hosting/capabilities HTTP/1.1", host: "localhost"

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

Hey, not sure that is the correct location. You might want to check out NGINX configuration — Nextcloud latest Administration Manual latest documentation and try adjust it like in the example. Also it should be text/javascript according to the example, not added twice.

1 Like