问题回顾
在Nginx服务器上执行了nginx -t命令,导致前端页面无法访问。
ps命令查看nginx进程如下命令:
ps -ef | grep nginx
可能通过这条命令,你无法知道,nginx使用的配置文件是哪一个
像这样,直接启动没有指定配置文件:
[root@mo sbin]# ./nginx
[root@mo sbin]# ps -ef | grep nginx
root 15510 1 0 21:41 ? 00:00:00 nginx: master process ./nginx
nobody 15511 15510 0 21:41 ? 00:00:00 nginx: worker process
root 15515 14879 0 21:41 pts/1 00:00:00 grep --color=auto nginx
如果是我,我启动nginx的时候会指定一个配置文件,这样对谁都好
[root@mo sbin]# ./nginx -c /home/weblogic/nginx1.14/conf/nginx.conf
[root@mo sbin]# ps -ef | grep nginx
root 15266 1 0 21:39 ? 00:00:00 nginx: master process ./nginx -c /home/weblogic/nginx1.14/conf/nginx.conf
nobody