linux环境下Nginx常用命令集合

/ 0条评论 / 0 个点赞 / 1278人阅读
查看nginx进程
ps -ef|grep nginx
关闭进程
kill -9 2132
cd到nginx目录下
cd /opt/module/nginx.1.18.0/sbin/
查看配置文件是否配置正确
./nginx -t

提示一下信息就表示配置正确

nginx: the configuration file /opt/module/nginx.1.18.0/conf/nginx.conf syntax is ok
nginx: configuration file /opt/module/nginx.1.18.0/conf/nginx.conf test is successful
重启nginx
./nginx -s reload
启动
./nginx

从指定目录启动nginx

./nginx -c /opt/work_xian/nginx.1.18.0/conf/nginx.conf