nginx: [emerg] “server” directive is not allowed here in …

文章
nginx: [emerg] “server” directive is not allowed here in …-下一朵云

在nginx.conf中配置增加sever配置或者添加虚拟主机配置文件后

出现报错:nginx: [emerg] “server” directive is not allowed here in …

原因为原因是Server{}http{}外面了,应该放在http{}里面:

http{
      sever{   

      }
}

如果是添加虚拟主机配置文件后报错,检查include vhost/*.conf;在nginx.conf中的位置是否在http{}

http{
  
    include vhost/*.conf;
}

版权声明:本文为下一朵云发布文章,转载请附上原文出处链接和本声明。
本文链接:https://www.orcy.net.cn/1748.html

​ 广告:HCIE-Security认证课程辅导资料(付费)

暂无评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注