Welcome to Centmin Mod Community
Register Now

Nginx Nginx warn log: [warn] : conflicting server name "domain.tools" on 0.0.0.0:80, ignored

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, Feb 27, 2015.

Tags:
  1. pamamolf

    pamamolf Well-Known Member

    2,721
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:09 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Hi

    I just found on nginx error log file this:

    Code:
    [warn] : conflicting server name "domain.tools" on 0.0.0.0:80, ignored
    Centos 7 with latest beta 08 centminmod.

    Any ideas?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    10:09 AM
    Nginx 1.13.x
    MariaDB 5.5
    You have that domain domain.tools referenced in more than one Nginx vhost so find out which file

    Code:
    grep -Ro domain.tools /usr/local/nginx/conf | uniq
     
  3. pamamolf

    pamamolf Well-Known Member

    2,721
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:09 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Code:
    /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf:domain.tools
    /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf:domain.tools
    /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf:domain.tools
    /usr/local/nginx/conf/conf.d/domain.tools.conf:domain.tools
    /usr/local/nginx/conf/conf.d/domain.tools.conf:domain.tools
    /usr/local/nginx/conf/conf.d/domain.tools.conf:domain.tools
    /usr/local/nginx/conf/conf.d/domain.tools.conf:domain.tools
    /usr/local/nginx/conf/conf.d/domain.tools.conf:domain.tools
    /usr/local/nginx/conf/conf.d/domain.tools.conf:domain.tools
    /usr/local/nginx/conf/conf.d/virtual.conf:domain.tools
    /usr/local/nginx/conf/phpmyadmin.conf:domain.tools

    I think the problem is here:

    Code:
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    server {
      listen  80;
      server_name www.domain.tools;
      return 301 $scheme://domain.tools$request_uri;
      }
    server {
      server_name domain.tools;
    But is it ok to comment the last two lines and all to work ok as i want also to rewrite www to none?

    Code:
    #server {
    #server_name domain.tools;
     
    Last edited: Feb 28, 2015
  4. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    10:09 AM
    Nginx 1.13.x
    MariaDB 5.5
    no no you should only be concerned with duplicates where server context container is related to listen port 80 and not server contexts which contain port 443
     
  5. pamamolf

    pamamolf Well-Known Member

    2,721
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:09 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Can't find it then :(
     
  6. Steve Tozer

    Steve Tozer Member

    70
    42
    18
    Jul 28, 2014
    South Wales, UK
    Ratings:
    +49
    Local Time:
    1:09 AM
    1.91
    10.0.19
    By any chance is the server hostname the same as the domain that its saying is conflicting?