Symptoms
When set Nginx Cache size and/or Cache timeout to 0
in Plesk > Domains > example.com > Apache & Nginx Settings > Enable Nginx caching Plesk shows a successful message:
Information: The settings were successfully updated.
However, the configuration is broken:
-
The following errors are logged in the file
/var/log/plesk/panel.log
:DEBUG [panel] Template_Exception: nginx: [emerg] invalid max_size value "max_size=" in /etc/nginx/plesk.conf.d/vhosts/example.com.conf:6
nginx: configuration file /etc/nginx/nginx.conf test failed
file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
trace: #0 /usr/local/psa/admin/plib/Template/Configuration/Applier.php(200): Template_Writer_Webserver_Abstract->test()
...
#12 /usr/local/psa/admin/sbin/nginxmng(4): require_once(string '/usr/local/psa/admin/plib/api-cli/CliUtilityRunner.php') -
The following error can be shown:
PLESK_ERROR: New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] invalid time value “” in /etc/nginx/plesk.conf.d/vhosts/example.com.conf:91 nginx: configuration file /etc/nginx/nginx.conf test failed
Cause
Product issue:
- #PPPM-12428 “Improved the nginx cache size validation.”
Fixed in:- Plesk Obsidian 27 October 2020 (Linux)
Resolution
Workaround
If update is not possible for some reason you may try the following
workaround
Set a value higher than 0
:
-
Connect to the server via SSH
-
Create a list containing the domains with Nginx caching enabled:
# mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -Ne “select d.id, d.name from domains d, dom_param dp, WebServerSettings…