Symptoms
-
On a Plesk for Linux server, nginx fails to start:
Job for nginx.service failed because a timeout was exceeded.
plesk systemd[1]: Starting Startup script for nginx service...
plesk systemd[1]: nginx.service start-pre operation timed out. Terminating.
plesk systemd[1]: Failed to start Startup script for nginx.service.
plesk systemd[1]: nginx.service: Unit entered failed state.
plesk systemd[1]: nginx.service: Failed with result 'timeout'. -
The option OCSP Stapling is enabled on one or more domains in Domains > example.com > SSL/TLS Certificates.
Cause
Due to enabled OCSP Stapling, nginx tries resolving OCSP URIs during the configuration check, and this operation is slow due to issues with connection to the DNS server which is the first resolver in the file /etc/resolv.conf
.
Resolution
-
Connect to the server using SSH.
-
Open the file
/etc/resolv.conf
for editing. -
Add one of the server's IP addresses, for example 127.0.0.1, as the first nameserver, and save the file:
nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 1.1.1.1