Sometimes it can happen that the NGINX configuration is invalid and the NGINX server is restarted with the ploi backend but crashes due to the invalid configuration. This has happened to me mostly due to errors in the LE certification process. Example:
$ nginx -t
nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/site.test/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/site.test/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed
In this case the solution is simple: delete the problematic LE certificate and recreate it. However, it is not good that the nginx server is unreachable for this time, because all other sites are also unreachable.
Suggestion for a solution: Every NGINX restart should first check the configuration and output any errors instead of restarting like YOLO :)
Hi @Dennis!
Thanks for looking into this. Yes, one thing would be a manual restart under [Server] > Manage > Restart NGINX. I do this after editing the NGINX configurations for a particular site. I am not sure if there are automatic restarts? Maybe after creating or editing an SSL configuration?
I'm just noticing that there seems to be a new feature, because I can now test the configuration after editing the NGINX configuration files, which is nice! However, if the configuration is invalid, it shows me the line number, but there are no line numbers in the file editor, so it would be nice to have that too. Just as a side note ;) So it seems to me that a manual restart is the only place where it would be nice to be able to check it first.