Welcome! Log In Create A New Profile

Advanced

Getting this error: Starting nginx: [warn]: conflicting server name domain2.com

March 10, 2010 02:37PM
I have two domains domain1.com and domain2.com. The settings I have for domain1.com are:

[code]
server {

listen 80;
server_name www.domain1.com;
rewrite ^/(.*) http://domain1.com/$1 permanent;

}


server {

listen 80;
server_name domain1.com;

access_log /home/test/public_html/domain1.com/log/access.log;
error_log /home/test/public_html/domain1.com/log/error.log;

location / {

root /home/test/public_html/domain1.com/public/;
index index.html;

}

}
[/code]


And the settings I have for domain2.com are:

[code]
server {

listen 80;
server_name domain2.com;
rewrite ^/(.*) http://www.domain2.com/$1 permanent;

}


server {

listen 80;
server_name domain2.com;

access_log /home/test/public_html/domain2.com/log/access.log;
error_log /home/test/public_html/domain2.com/log/error.log;

location / {

root /home/test/public_html/domain2.com/public/;
index index.html;

}

}
[/code]

The main difference is in the re-write rule. In the current state when I start nginx I get the following error:

[code]
Starting nginx: [warn]: conflicting server name "domain2.com" on 0.0.0.0:80, ignored
nginx.
[/code]

And accessing domain2.com will lead to nginx welcome page.

If I change the re-write rule of domain2.com to match domain1.com then the warning message disappears and I can access domain2.com page just fine.

Any help please?

Thanks
Subject Author Posted

Getting this error: Starting nginx: [warn]: conflicting server name domain2.com

d3l0n March 10, 2010 02:37PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 315
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready