1、实际项目部署中有多台服务器,一定要注意nginx部署在哪台。使用systemctl status nginx.service查看运行状态
运行着的:
关闭的:
2、查看文件目录
a、查看 nginx 安装目录
ps -ef | grep nginx
b、查看配置文件 nginx.conf 路径
nginx -t
c、find 命令进行文件查找
##从etc目录下查找
find ./etc -name nginx.conf
3、启动关停
service nginx start
service nginx stop
service nginx restart
service nginx reload
4、编辑
vim nginx.conf
i开始编辑
esc停止编辑
ctrl + i 命令行输入 wq! 保存退出 q!不保存退出