[Solved] Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid

Restart the server, access the web service and find that you can’t browse! After logging in to the server, I went to nginx and used. /nginx -s reload to re-read the configuration file, and found that nginx: [error] open() “/usr/local/nginx/logs/nginx.pid” failed (2: No such file or directory), went to the logs file and found that there was no nginx.pid file
[[email protected] sbin]# . /nginx -s reload
nginx: [error] open() “/usr/local/nginx/logs/nginx.pid” failed (2: No such file or directory)

[[email protected] nginx]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
Use the nginx -c argument to specify the location of the nginx.conf file
[[email protected] nginx]# cd logs/
[[email protected] logs]# ll
Total usage 12
-rw-r–r– 1 root root 1246 Dec 9 18:10 access.log
-rw-r–r– 1 root root 516 Dec 10 15:39 error.log
-rw-r–r– 1 root root 5 Dec 10 15:38 nginx.pid
Look at the nginx.pid file already.

Similar Posts: