• 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 New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx:

webcity

New Pleskian
Hi,

I'm running Plesk Obsidian Web Pro Edition Version 18.0.25.

I've made changes in Apache & nginx Settings for one of my domains.
Incorrectly I added
Code:
.php
in the "Disable caching for locations" box. When I pressed the OK button to accept the changes I got an error message. I removed the code from the box and now when I press Apply, I get the error:

Invalid nginx configuration: nginx: [emerg] pcre_compile() failed: nothing to repeat in "*.php" at "*.php" in /etc/nginx/plesk.conf.d/vhosts/mydomain.co.uk.conf:47 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.

I can't seem to remove the code from the box, when I delete the code and press Apply or OK.

And now I get the error message at the top of my Websites and Domains:

Code:
New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] pcre_compile() failed: nothing to repeat in "*.php" at "*.php" in /etc/nginx/plesk.conf.d/vhosts/mydomain.co.uk.conf:47 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. See the details in Configuration Troubleshooter

I've tried to generate the broken configuration files but it still has the error.

Can you suggest a solution to the problem? Is there a file I can edit to restore the file to the original settings?

Many thanks
 
Hi,

Thanks for your help.

I tried that option and also the "Webserver Configurations Troubleshooter" repair option too.

Both option fail with can't create new file.

Many thanks
 
Hi,

Thanks for your help.

I tried that option and also the "Webserver Configurations Troubleshooter" repair option too.

Both option fail with can't create new file.

Many thanks
Try it in ssh
Other way, try to edit and put correctly file /etc/nginx/plesk.conf.d/vhosts/mydomain.co.uk.conf, then restart nginx, then go again to nginx/apache option of the domain an save the change without any adicional line
Another way is to delete file directly rm -f /etc/nginx/plesk.conf.d/vhosts/mydomain.co.uk.conf then restart nginx, then go again to nginx/apache option of the domain an save the change without any adicional line
 
Hi,

Thanks for your help.

I tried deleting the file, restarting nginx, a new mydomain.co.uk.conf file is created but it is still using the old settings with the error. When deleting the .php and trying to save, I still get the error.

I also get the error message emailed to me:

Code:
Unable to generate the web server configuration file on the host <host.mydomain.co.uk> because of the following errors:

Template_Exception: nginx: [emerg] pcre_compile() failed: nothing to repeat in "*.php" at "*.php" in /etc/nginx/plesk.conf.d/vhosts/ukclassifieds.co.uk.conf:47
nginx: configuration file /etc/nginx/nginx.conf test failed

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0

Please resolve the errors in web server configuration templates and generate the file again.

Can you suggest any other options?

Many thanks
 
Hi,

Thanks for your help.

I tried deleting the file, restarting nginx, a new mydomain.co.uk.conf file is created but it is still using the old settings with the error. When deleting the .php and trying to save, I still get the error.

I also get the error message emailed to me:

Code:
Unable to generate the web server configuration file on the host <host.mydomain.co.uk> because of the following errors:

Template_Exception: nginx: [emerg] pcre_compile() failed: nothing to repeat in "*.php" at "*.php" in /etc/nginx/plesk.conf.d/vhosts/ukclassifieds.co.uk.conf:47
nginx: configuration file /etc/nginx/nginx.conf test failed

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0

Please resolve the errors in web server configuration templates and generate the file again.

Can you suggest any other options?

Many thanks
If there is no sensible data on your server, give us your server access by MP and I can try to review it.
 
Hi,

Thanks for your help and kind offer, it is much appreciated. The sites on the server contain customers data so I would like to try and solve the problem if possible without giving access to the server.

I'll try and dig around the forums some more to see if I can find a resolution to the problem, unless anyone could suggest any other options to try?

Many thanks
 
Hi,

Thanks for your help and kind offer, it is much appreciated. The sites on the server contain customers data so I would like to try and solve the problem if possible without giving access to the server.

I'll try and dig around the forums some more to see if I can find a resolution to the problem, unless anyone could suggest any other options to try?

Many thanks
I understand of course.
I recommand you delete file for now
/etc/nginx/plesk.conf.d/vhosts/ukclassifieds.co.uk.conf
and restart nginx

Almost you will have web service...
 
Hi,

I'm still trying to find resolve the problem.

I have deleted the /etc/nginx/plesk.conf.d/vhosts/mydomain.conf , when generating the new file what is the backup or other file that it uses to create the new file? This seems to have the wrong settings too.

Thanks for your help
 
Back
Top