• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Unknown "no_cache" variable nginx

Shibumi

Basic Pleskian
TITLE:
Unknown "no_cache" variable nginx

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:
OS ‪CentOS Linux 7.4.1708 (Core)‬
Product Plesk Onyx
Version 17.8.11

PROBLEM DESCRIPTION:
The following error shows up in Plesk after upgrade from Plesk 17.5 #43 to 17.8.11 #2:
New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] unknown "no_cache" variable nginx: configuration file /etc/nginx/nginx.conf test failed . Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files.

We have tried to find the parameter "no_cache" in nginx configuration files in /etc/nginx/(and sub directories) & /var/www/vhosts/system/(and sub directories) but couldn't locate that parameter in any file.

Even using plesk repair web doesn't work:

httpdmng failed: [2018-03-20 16:17:12.243] ERR [util_exec]
proc_close() failed ['/usr/local/psa/admin/bin/nginx-config'
'-t'] with exit code [1]
[2018-03-20 16:17:12.882] ERR [panel] Apache config
(15215590310.88873800) generation failed: Template_Exception:
nginx: [emerg] unknown "no_cache" variable
nginx: configuration file /etc/nginx/nginx.conf test failed

file:
/usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
nginx: [emerg] unknown "no_cache" variable
nginx: configuration file /etc/nginx/nginx.conf test failed

Any help would be appreciated.

With best regards.
 
TITLE:
Unknown "no_cache" variable nginx

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:
OS ‪CentOS Linux 7.4.1708 (Core)‬
Product Plesk Onyx
Version 17.8.11

PROBLEM DESCRIPTION:
The following error shows up in Plesk after upgrade from Plesk 17.5 #43 to 17.8.11 #2:
New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] unknown "no_cache" variable nginx: configuration file /etc/nginx/nginx.conf test failed . Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files.

We have tried to find the parameter "no_cache" in nginx configuration files in /etc/nginx/(and sub directories) & /var/www/vhosts/system/(and sub directories) but couldn't locate that parameter in any file.

Even using plesk repair web doesn't work:

httpdmng failed: [2018-03-20 16:17:12.243] ERR [util_exec]
proc_close() failed ['/usr/local/psa/admin/bin/nginx-config'
'-t'] with exit code [1]
[2018-03-20 16:17:12.882] ERR [panel] Apache config
(15215590310.88873800) generation failed: Template_Exception:
nginx: [emerg] unknown "no_cache" variable
nginx: configuration file /etc/nginx/nginx.conf test failed

file:
/usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
nginx: [emerg] unknown "no_cache" variable
nginx: configuration file /etc/nginx/nginx.conf test failed

Any help would be appreciated.

With best regards.

Hello,
no_cache directive is added in your vhost configuration when you enable micro-caching on a website. Try to disable Nginx micro-cache
configuration files are located in /etc/nginx/plesk.d/vhosts but are automatically regenerated by Plesk.
 
Hello,
no_cache directive is added in your vhost configuration when you enable micro-caching on a website. Try to disable Nginx micro-cache
configuration files are located in /etc/nginx/plesk.d/vhosts but are automatically regenerated by Plesk.

Disabling microcaching acomplish nothing, the error is still showing up no matter what.
 
Hello,

The issue might be caused by outdated custom vhost templates created on 17.5. Plesk 17.8 brings new features, so in case you have custom vhost templates from 17.5 configuration templates for domains will be generated incorrectly.

Pre-upgrade checker verifies such situation, so you should have the corresponding warning from Plesk before the upgrade.

Solution:
If you have anything in /usr/local/psa/admin/conf/templates/custom/ then move these files out and reconfigure Apache + Nginx:

Clean up Plesk db from current errors:
# plesk db "delete from Configurations where status <> 'ok';"

Recreate configuration:
# plesk repair web
 
Thanks Anton. That fixed the issue, but now it seems that nginx has an error in an SSL certificate

nginx -t
nginx: [emerg] BIO_new_file("/usr/local/psa/var/certificates/cert-DOg86s") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/psa/var/certificates/cert-DOg86s','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed
 
Thanks Anton. That fixed the issue, but now it seems that nginx has an error in an SSL certificate

nginx -t
nginx: [emerg] BIO_new_file("/usr/local/psa/var/certificates/cert-DOg86s") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/psa/var/certificates/cert-DOg86s','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed

Check that this is webmail certificate with something like

# grep -r cert-DOg86s /etc/nginx/plesk.conf.d/*
/etc/nginx/plesk.conf.d/webmails/example.com_webmail.conf: ssl_certificate /usr/local/psa/var/certificates/cert-DOg86s;

If it is so, clean up all webmail configuration files, including redundant:

# rm -f /etc/nginx/plesk.conf.d/webmails/*

And then rebuild web server configuration files:

# plesk repair web
 
Back
Top