- $ sudo ps -ef | grep nginx
nfuser 22202 21376 0 19:12 pts/0 00:00:00 grep --color=auto nginx
root 22920 1 0 Feb24 ? 00:00:00 nginx: master process nginx
nginx 26668 22920 0 Feb25 ? 00:00:50 nginx: worker process
找到nginx: master process对应的PID,即 22920 - $ sudo ls -l /proc/22920/exe
lrwxrwxrwx 1 root root 0 Jun 21 11:13 /proc/22920/exe -> /usr/sbin/nginx
查看当前执行的nginx路径,即 /usr/sbin/nginx - $ /usr/sbin/nginx -t
查看nginx使用的参数配置文件,即 /etc/nginx/nginx.conf
查看nginx正在使用的配置文件
最新推荐文章于 2025-09-14 21:03:34 发布
本文介绍如何通过Linux命令查找Nginx主进程的PID及其执行路径,并展示了如何验证Nginx配置文件的正确性。
1132

被折叠的 条评论
为什么被折叠?



