After restarting the Linux server, the process of Nginx-s stop after the start of nginx-s Reload, will always report the error nginx: [ERROR] Open () "/alidata/server/nginx/logs/nginx.pid "Failed (2:no such file or directory), this should be because the nginx process killed after the PID is lost, the next time the Nginx-s reload will not start, the reload can solve the problem, but too much trouble.
issued a nginx-s stop and after that I got this error when trying to reload it.
[ERROR]: Invalid PID number "in"/var/run/nginx.pid "
That/var/run/nginx/pid file is empty ATM.
What does I need to fix it?
Nginx-s Reload is the only used-to-tell a running nginx process-to-reload its config. After a stop, you don't have a running nginx process to send a signal to. Just Run Nginx (possibly with a-c/path/to/config/file)
The method is simple:
1. First you have to make sure that the Nginx process is closed (you can close the process by pkill-9 Nginx)
2. Enter your Nginx installation directory inside the CD ' Path/nginx/sbin ' and enter Nginx-c. /conf/nginx.conf can be (sbin directory below an nginx for the launcher,-C for what configuration start, followed by the path of the Nginx configuration file)
Solving the PID disappearance problem of Nginx after restarting Linux operating system