《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時,出現如下錯誤:
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 vephp.com;
# return 301 http://www.fzlkiss.com$request_uri;
}
只要全部注釋掉就好
#server { # listen 80; # server_name vephp.com; # 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.fzlkiss.com"
on
0.0.0.0:80, ignored
那可能是你的一個域名綁定了多個站點。同一個域名解析到了不同的目錄。一般將配置文件單獨分離出來容易出現這個錯誤。
修正即可。