《nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored》要點(diǎn):
本文介紹了nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored,希望對您有用。如果有疑問,可以聯(lián)系我們。
相關(guān)主題:nginx配置
在啟動Nginx時,出現(xiàn)如下錯誤:
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.snjht.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
注意:
如果你的錯誤提示中出現(xiàn)了域名,比如:
nginx: [warn] conflicting server name
"www.snjht.com"
on
0.0.0.0:80, ignored
那可能是你的一個域名綁定了多個站點(diǎn)。同一個域名解析到了不同的目錄。一般將配置文件單獨(dú)分離出來容易出現(xiàn)這個錯誤。
修正即可。
轉(zhuǎn)載請注明本頁網(wǎng)址:
http://www.snjht.com/jiaocheng/14641.html