Symptoms
-
It is not possible to restore website configuration with the error:
ERR [panel] Apache config
(16100623580.33783700) generation failed: Template_Exception:
mkdir: cannot create directory '/etc/nginx/plesk.conf.d': No
such file or directory
mktemp: failed to create file via template
'/etc/nginx/plesk.conf.d/server.conf.XXXXXX': No such file or
directory
Can not create temporary filefile:
/opt/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
mkdir: cannot create directory '/etc/nginx/plesk.conf.d': No
such file or directory
mktemp: failed to create file via template
'/etc/nginx/plesk.conf.d/server.conf.XXXXXX': No such file or
directory
Can not create temporary file -
Test nginx configuration fails:
# nginx -t
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
2021/01/08 04:02:22 [emerg] 32934#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
Cause
Plesk ships its own, pre-configured nginx.
The installed nginx package corrupted or replaced with incorrect one.
Resolution
via Plesk UI
- Log into Plesk
- Go to Tools & Settings > Updates > Add/Remove Components
- Uninstall nginx
- Install it back in the same way
- Repair web configuration
via CLI
-
Connect to the server via SSH
-
Remove nginx
# /usr/local/psa/admin/bin/autoinstaller --select-product-id plesk --select-release-current --remove-component nginx
-
Install nginx
# plesk installer --select-release-current --install-component nginx
-
Repair the configuration:
# plesk repair web -y