The current configuration file used by nginx is /etc/nginx/conf.d/default.conf
Now I want to add a new domain name binding, so I added
to the last line of default.confinclude theDomain.conf;
In theDomain.conf, the bound port is 80, server_name www.thedomain.com;
Reload configuration nginx -s reload
Error report:
nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "www.thedomain.com" on 0.0.0.0:80, ignored
I have no experience using nginx. Please give me some advice on how to deal with this situation. Thank you! ~
I just tried it and the domain name resolution was successful. nginx: [warn] This warning can be ignored, right?
过去多啦不再A梦2017-05-16 17:12:22
The error message means that two words were writtenserver_name
。在一个环境内出现了两次不一样的server_name
server_name
应该写在某个server
里面,只能有一个,写在 server
What’s outside is the overall picture.
server {
port 80;
sever_name thedomain.com;
}
滿天的星座2017-05-16 17:12:22
The configuration file for Nginx multiple domain name resolution should be like this:
server
{
listen 80;
server_name baidu.com;
}
server
{
listen 80;
server_name qq.com;
}
黄舟2017-05-16 17:12:22
There are two ways, one is multiple sever mentioned above, today I tried another
server
{
listen 80;
server_name baidu.com qq.com;
}