Join the community today
Become a Member

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

    4,028
    421
    83
    May 31, 2014
    Ratings:
    +817
    Local Time:
    6:25 AM
    Nginx-1.17.x
    MariaDB 10.3.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

    50,891
    11,793
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,248
    Local Time:
    2:25 PM
    Nginx 1.25.x
    MariaDB 10.x
    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

    4,028
    421
    83
    May 31, 2014
    Ratings:
    +817
    Local Time:
    6:25 AM
    Nginx-1.17.x
    MariaDB 10.3.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

    50,891
    11,793
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,248
    Local Time:
    2:25 PM
    Nginx 1.25.x
    MariaDB 10.x
    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

    4,028
    421
    83
    May 31, 2014
    Ratings:
    +817
    Local Time:
    6:25 AM
    Nginx-1.17.x
    MariaDB 10.3.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:
    4:25 AM
    1.91
    10.0.19
    By any chance is the server hostname the same as the domain that its saying is conflicting?