Join the community today
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

    3,117
    295
    83
    May 31, 2014
    Ratings:
    +531
    Local Time:
    10:08 PM
    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

    36,848
    8,064
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,422
    Local Time:
    6:08 AM
    Nginx 1.15.x
    MariaDB 5.5/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

    3,117
    295
    83
    May 31, 2014
    Ratings:
    +531
    Local Time:
    10:08 PM
    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

    36,848
    8,064
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,422
    Local Time:
    6:08 AM
    Nginx 1.15.x
    MariaDB 5.5/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

    3,117
    295
    83
    May 31, 2014
    Ratings:
    +531
    Local Time:
    10:08 PM
    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:
    8:08 PM
    1.91
    10.0.19
    By any chance is the server hostname the same as the domain that its saying is conflicting?
     
..