在重启nginx时报错误。
[email protected] ~ $ sudo /usr/sbin/nginx -s reload nginx: [error] invalid PID number "" in "/run/nginx.pid"
google一番,下面是解决办法
nginx -s reload is 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)
我本机的是用下面的命令
[email protected] /etc/nginx $ sudo /usr/sbin/nginx -c /etc/nginx/nginx.conf
时间: 2024-12-29 16:36:16