Nginx(一)几个常用的nginx命令

我使用的是yum 安装的Nginx(.rpm)

使用的配置文件为源目录下配置文件 /etc/nginx/nginx.conf 
-c <path_to_config>:使用指定的配置文件而不是 conf 目录下的 nginx.conf 。

  • nginx启动
sudo systemctl start nginx.service
  • /重启restart/停止stop 【nginx -s reload】
nginx -s reload
  • nginx检查配置【nginx -t】测试配置文件是否正确,在运行时需要重新加载配置的时候,此命令非常重要,用来检测所修改的配置文件是否有语法错误。
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

猜你喜欢

转载自blog.csdn.net/chen649053473/article/details/81777317