Nginx 相关命令

Nginx 相关命令

nginx 启动

./nginx -c /usr/local/webserver/nginx/conf/nginx.conf

其中,/usr/local/webserver/nginx/conf/nginx.conf 是 nginx.conf 路径

  • -c参数指定加载的 nginx.conf 配置文件路径

nginx 重启
进入 nginx 安装目录下的 sbin 目录下
执行

./nginx -s reload

查找 nginx 所在位置

whereis nginx

通过配置文件查找

locate nginx.conf

没有安装 locate 命令,find 命令查找

find / -name nginx.conf 

通过进程查找

ps aux|grep nginx

查看 nginx 配置文件
进入 sbin 目录下,执行以下命令

./nginx -t

返回类似下列信息

nginx: the configuration file /usr/local/webserver/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/webserver/nginx/conf/nginx.conf test is successful

则 /usr/local/webserver/nginx/conf/nginx.conf 就是配置文件

最后修改于 2020年5月4日 22:21:29

posted @ 2020-05-04 22:22  crazy-jarvis  阅读(173)  评论(0编辑  收藏  举报