nginx: [emerg] "if" directive is not allowed here 1. 错误含义 nginx: [emerg] "if" directive is not allowed here 错误表明你在 Nginx 配置文件中错误地放置了 if 指令。if 指令在 Nginx 中有其特定的使用上下文,如果放置在不支持的上下文中,Nginx 将无法启动并报告此错误。
directive is not allowed here in:指令不被允许在这,proxy_cache_path 只能适用于nginx配置-http{ }段。BT面板nginx-proxy_cache_path在http{ }段正确配置如下:问题总结 directive is not allowed这类指令,多为指令应用范围问题,找到相关指令信息转移到报错目标文件适用段即可解决。
root@localhost conf]# /usr/local/nginx/sbin/nginx -t nginx: [emerg] "server" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:106 nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed 1. 2. 3. 使用的Nginx版本: root@localhost conf]# /usr/local/nginx...
nginx: [emerg] "server" directive is not allowed here in /etc/nginx/conf.d/default.conf:1 nginx: configuration file /etc/nginx/conf.d/default.conf test failed 有时候文件是正确无误,但是也会报错。 实际问题是进行语法检测的对象有问题; 要检测现有的修改过的Nginx配置是否有错误,不是只检测 .conf...
Nginx需要用到stream, 配置后 nginx -t 提示缺少模块 nginx: [emerg] "stream" directive is not allowed here 如果是源文件安装的话,进入安装目录重新安装,并在末尾加 ./configure --prefix=/usr/local/nginx --with-pcre=/app/software/pcre-8.43 --with-zlib=/app/software/zlib-1.2.11 --with-openssl...
root@localhost conf]#/usr/local/nginx/sbin/nginx-tnginx:[emerg]"server"directive is not allowed herein/usr/local/nginx/conf/nginx.conf:106nginx:configuration file/usr/local/nginx/conf/nginx.conf test failed 使用的Nginx版本: 代码语言:javascript ...
⼀、问题 "server" directive is not allowed here in /etc/nginx/nginx.conf:69 ⼆、原因 三、结论 配置信息⾥边多加了⼀个⼤括号 应该是:http { server{ } } 把server 写在http 外⾯也不⾏ 四、解决⽅案 后记 虽然是⼀个⼩⼩的问题,防⽌以后踩坑,这⾥记录⼀下。
简介:nginx开启ssl报错: [emerg] "server" directive is not allowed here ... 报错信息如下: root@localhost conf]# /usr/local/nginx/sbin/nginx -tnginx: [emerg] "server" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:106nginx: configuration file /usr/local/nginx/conf/nginx...
Ubuntu 14.04, Nginx 1.10.3: after updating all the vhost files nginx -t reports broken configuration: [emerg] "if" directive is not allowed here in /etc/nginx/bots.d/blockbots.conf:40
nginx: [emerg] “user” directive is not allowed here in /etc/nginx/conf.d/nginx.conf:1。 这个报错是因为:把nginx.conf是要放在了/etc/nginx/conf.d/目录下。 导致nginx.conf文件又引入nginx.conf文件,引入是引入到http块中,当然不能有"user"指令 ...