原文:nginx检查报错:nginx: [emerg] "server" directive is not allowed here in

想检查一个配置文件是否正确, c 指定之后发现有报错,如下: 有时候文件是正确无误,但是也会报错。 实际问题是进行语法检测的对象有问题 要检测现有的修改过的Nginx配置是否有错误,不是只检测 .conf文件,而是不管任何时候,始终都是去检测主文件 etc nginx nginx.conf,只有这样,才能顺利的在对应的模块加载.conf文件。 这样保证了配置的前后语境的正确性,这样才是真正的检测。 ...

2019-09-21 17:34 0 11613 推荐指数:

查看详情

nginx检查报错nginx: [emerg] "server" directive is not allowed here in

检查一个配置文件是否正确,-c 指定之后发现有报错,如下: 有时候文件是正确无误,但是也会报错。 实际问题是进行语法检测的对象有问题; 要检测现有的修改过的Nginx配置是否有错误,不是只检测 .conf文件,而是不管任何时候,始终都是去检测主文件/etc/nginx ...

Fri Nov 15 22:10:00 CST 2019 0 936
nginx服务运行失败nginx: [emerg] "server" directive is not allowed here

下午一台阿里云服务器上的Nginx突然停止运行,服务失败。 journalctl -xe查看具体的报错信息其中有显示,但是没有显示是具体那个nginx的配置文件有问题 然后更进一步查看nginx的error日志 应该会有具体的显示报错位置 cat /www/server ...

Fri Aug 20 22:16:00 CST 2021 0 564
nginx: [emerg] "upstream" directive is not allowed here in .../.../.../*.conf

因为临时需要在本机搭建一个nginx服务使用,其实很简单的一个本地server,但是运行的时候就报错检查了我的配置文件 test.com.conf 发现也没有问题: 然后网上查了一下说是“upstream”不能再http这个block里面,于是查看了一下 ...

Sun Mar 01 08:56:00 CST 2020 0 6053
Nginx 配置问题 server directive is not allowed here in /etc/nginx/nginx.conf:69

前沿 今天在其他服务器上重新配置 nginx.conf 文件,配置结束启动 nginx 发现遇到了这样一个错误,我擦…?我配置文件都是从上个服务器上 复制粘贴过来的,怎么会遇到这个问题呢?百思不得其解,最终在网上百度了一下,得到了解决方案。 一、问题 二、原因 三、结论 ...

Wed Nov 24 17:52:00 CST 2021 0 178
linux之"server" directive is not allowed here in

配置完rewrite之后重启nginx发现如下错误 "server" directive is not allowed here in* 原因是因为 外部配置的simple.conf没有include到nginx.conf的http{}里面 修改nginx.conf之后解决 ...

Thu Apr 16 19:01:00 CST 2015 0 6035
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM