加入收藏 | 设为首页 | 会员中心 | 我要投稿 莱芜站长网 (https://www.0634zz.com/)- 云连接、建站、智能边缘云、设备管理、大数据!
当前位置: 首页 > 运营中心 > Nginx > 正文

nginx: [warn] conflicting server name on 0.0.0.0:80, ignored

发布时间:2020-07-03 11:08:13 所属栏目:Nginx 来源:互联网
导读:介绍《nginx: [warn] conflicting server name on 0.0.0.0:80, ignored》开发教程,希望对您有用。

《nginx: [warn] conflicting server name "" on 0.0.0.0:80,ignored》要点:
本文介绍了nginx: [warn] conflicting server name "" on 0.0.0.0:80,ignored,希望对您有用。如果有疑问,可以联系我们。

在启动Nginx时,出现如下错误:

nginx: [warn] conflicting server name "" on 0.0.0.0:80,ignored

检查:


[root@iZuf67db nginx]# nginx -t
nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored


这个是因为在配置文件中,有空的server{},如下:

server {

#    listen       80;

#    server_name  jb51.cc;

#    return       301 http://www.jb51.cc$request_uri;

}


只要全部注释掉就好

#server {
#    listen       80;
#    server_name  jb51.cc;
#    return       301  
#}


再检查就不会出错:

[root@iZuf67db vhost]# nginx -t

the configuration file /nginx/conf/nginx.conf syntax is ok

configuration file /nginx/conf/nginx.conf test is successful



注意:

如果你的错误提示中出现了域名,比如:

nginx: [warn] conflicting server name "www.jb51.cc" on 0.0.0.0:80,ignored


那可能是你的一个域名绑定了多个站点。同一个域名解析到了不同的目录。一般将配置文件单独分离出来容易出现这个错误。

修正即可。

(编辑:莱芜站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读