Score:0

Nginx conflicting server name "" on 0.0.0.0:80, ignored

in flag

I cannot figure out how to resolve the following warning when running nginx -t:

2022/12/29 05:10:23 [warn] 24920#24920: conflicting server name "" on 0.0.0.0:80, ignored
2022/12/29 05:10:23 [warn] 24920#24920: conflicting server name "" on [::]:80, ignored

I have two sites running on my server.

  1. home.conf
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/home;

    index index.html

    server_name int.mycompany.lan;

    location / {
       # First attempt to serve request as file, then
       # as directory, then fall back to displaying a 404.
       try_files $uri $uri/ =404;
    }
 }
  1. bug.conf
server {
    listen 80;
    listen [::]:80;

    root /var/www/bug;

    index index.html

    server_name bug.int.mycompany.lan;

    location / {
       # First attempt to serve request as file, then
       # as directory, then fall back to displaying a 404.
       try_files $uri $uri/ =404;
    }
 }

Going to the site bug.int.mycompany.lan always shows me the int.mycompany.lan site instead.

If I remove the symlink to one of these files from /etc/nginx/sites-enabled or if I change the port on one of the sites to something like 8081 then I no longer get the error above.

Score:0
in flag

Silly mistake. I deleted the semi-colon on the index line. That took me several hours to spot.

Nikita Kipriyanov avatar
za flag
please accept your own answer to mark question as solved
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.