Nextcloud version (eg, 20.0.5): 28.0.0
(but problem exists since updating to 27.0.8
Operating system and version (eg, Ubuntu 20.04): Synology DSM 7.1.1
Apache or nginx version (eg, Apache 2.4.25): Apache 2.2
PHP version (eg, 7.4): `php8.0’
The issue you are facing:
Is this the first time you’ve seen this error? (Y/N): no
Steps to replicate it:
- get latest .htaccess with
# Add cache control for static resources
<FilesMatch "\.(css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite)$">
<If "%{QUERY_STRING} =~ /(^|&)v=/">
Header set Cache-Control "max-age=15778463, immutable"
</If>
<Else>
Header set Cache-Control "max-age=15778463"
</Else>
</FilesMatch>
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 (
'instanceid' => '',
'passwordsalt' => '',
'secret' => '',
'trusted_domains' =>
array (
0 => '',
),
'datadirectory' => '',
'overwrite.cli.url' => '',
'dbtype' => 'mysql',
'version' => '28.0.0.11',
'dbname' => '',
'dbhost' => '1',
'dbtableprefix' => 'oc_',
'dbuser' => '',
'dbpassword' => '',
'logtimezone' => 'UTC',
'installed' => true,
'maintenance' => false,
'theme' => '',
'loglevel' => 2,
'trashbin_retention_obligation' => 'auto',
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'ssl',
'mail_from_address' => '',
'mail_domain' => '',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => 1,
'mail_smtphost' => '',
'mail_smtpport' => '',
'mail_smtpname' => '',
'mail_smtppassword' => '',
'htaccess.RewriteBase' => '/nextcloud',
'updater.release.channel' => 'stable',
'debug' => false,
'mail_sendmailmode' => 'smtp',
'mysql.utf8mb4' => true,
'encryption.legacy_format_support' => false,
'encryption.key_storage_migrated' => false,
'default_phone_region' => 'DE',
'memcache.local' => '\\OC\\Memcache\\APCu',
'filelocking.enabled' => true,
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'localhost',
'port' => 6379,
'timeout' => 0.0,
'password' => '',
),
);
The output of your Apache/nginx/system log in /var/log/____
:
2023-12-17T11:11:46+01:00 [Sun Dec 17 11:11:46 2023] [alert] [client ] /volume1/host/nextcloud/.htaccess: Invalid command '<If', perhaps misspelled or defined by a module not included in the server configuration, referer: /
The issue can be fixed by replacing the Cache control for static recources with
<FilesMatch "\.(css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite)$">
Header set Cache-Control "max-age=15778463"
</FilesMatch>
I believe that i had read this somewhere in the forum here before, but wasn’t able to find it anymore.
Can anyone specifiy why this would not work in my configuration? Since not many people seem to have this issue.
Thank you.