nginx

找到 nginx 执行程序所在目录

以下样例均使用 /opt/nginx/sbin/nginx 文件路径。

检测配置文件语法是否正确

1
2
3
4
5
[root@ioc-nginx ~]# /opt/nginx/sbin/nginx -t /opt/nginx/conf/nginx.conf
结果返回
nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/nginx/conf/nginx.conf test is successful

如果所有文件都是使用默认安装位置,也可以直接 nginx -t ,会自动寻找到默认位置的配置文件。 /usr/local/nginx/conf/nginx.conf/etc/nginx/nginx.conf

重新加载配置文件

1
[root@ioc-nginx ~]# /opt/nginx/sbin/nginx -s reload
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2022-2023 ligongzhao
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信