1、使用 命令ps aux | grep nginx查找nginx 运行目录,如下图:

2、使用 命令cd /usr/sbin 切换到nginx 运行目录,如下图:

3、修改配置文件后,使用 nginx -t 命令测试nginx配置文件的语法是否正确,如下图:

4、使用 命令 systemctl reload nginx 重新配置nginx ,如下图:

5、使用 命令systemctl status nginx查看nginx 运行状态,如下图:

6、另外有启动和停止nginx的命令:systemctl start nginx和systemctl stop nginx,在这儿就不做演示了。