CentOS7 nginx Failed to read PID from file /run/nginx.pid: Invalid argument?

1. On centos7, after configuring the nginx proxy service,

systemctl status nginx.service

error:

Failed to read PID from file /run/nginx.pid: Invalid argument

2. See a lot of said to delete change nginx.pid file, after trying, invalid.

. 3. Then a solution was found:

the mkdir -p/etc/systemd/system/nginx. Service. D.

printf “[Service] \ nExecStartPost =/bin/sleep 0.1 \ n” & gt; /etc/systemd/system/nginx.service.d/override.conf

4. Finally, execute the command

systemctl daemon – reload

systemctl restart nginx.service

solves the problem

Read More: