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?
The error message means that two words were written
server_name
。在一个环境内出现了两次不一样的server_name
server_name
应该写在某个server
里面,只能有一个,写在server
What’s outside is the overall picture.The configuration file for Nginx multiple domain name resolution should be like this:
server {
}
There are two ways, one is multiple sever mentioned above, today I tried another
server
{
}