Symptoms
-
Plesk Premuim Email extension by Kolab is installed and enabled.
-
The following error is displayed when trying to apply the configuration at Domains > example.com > Apache & nginx page:
Invalid nginx configuration: nginx: [emerg] "server" directive is not allowed here in /etc/nginx/plesk.conf.d/vhosts/example.com.conf:31 nginx: configuration file /etc/nginx/nginx.conf test failed
Unable to use the current nginx configuration file and to rollback to the previous version of the file because they both contain invalid configuration.
Cause
Plesk Premuim Email extension provides invalid mail autodiscovery section to templates during building Nginx virtual host configuration files.
This is extension bug with ID PPPM-14026.
Resolution
Until the bug is fixed, apply the next workaround:
Debian-based OS (Debian, Ubuntu)
-
Connect to the server via SSH.
-
Backup original
/opt/psa/admin/plib/Template/Processor.php
file:# cp -a /opt/psa/admin/plib/Template/Processor.php{,.bak}
-
Download custom fixed file:
# curl -LO https://support.plesk.com/hc/en-us/article_attachments/15329755898519/Processor.php
-
Replace the original file:
# mv -f ./Processor.php /opt/psa/admin/plib/Template/Processor.php
RHEL-based OS (centOS, AlmaLinux, CloudLinux)
-
Connect to the server via SSH.
-
Backup original
/usr/local/psa/admin/plib/Template/Processor.php
file:# cp -a /usr/local/psa/admin/plib/Template/Processor.php{,.bak}
-
Download custom fixed file:
# curl -LO https://support.plesk.com/hc/en-us/article_attachments/15329755898519/Processor.php
-
Replace the original file:
# mv -f ./Processor.php /usr/local/psa/admin/plib/Template/Processor.php