nginx.ccWeb server troubleshooting desk
Home / Errors / warn
warn

nginx warning: conflicting server name … ignored

Short answer

“conflicting server name "example.com" on 0.0.0.0:80, ignored” means two server blocks on the same address and port declare the same name; the one read later is ignored, so your edits may not apply at all. Use nginx -T to find the duplicate and remove the extra file (often default, a .bak copy, or a duplicate symlink in sites-enabled).

Most common cause: Backup files (example.conf.bak, example.conf~) left in sites-enabled are picked up when the include is not limited to *.conf.

Try this first: Remove the duplicate site file

rm /etc/nginx/sites-enabled/example.conf.bak
nginx -t && systemctl reload nginx

Last verified: · against the official docs listed below · Sources

Typical log lines

nginx: [warn] conflicting server name "example.com" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "example.com" on [::]:443, ignored

Common causes

  1. Backup files (example.conf.bak, example.conf~) left in sites-enabled are picked up when the include is not limited to *.conf.
  2. The same site exists in both conf.d and sites-enabled.
  3. certbot --nginx rewrote the file and a second server with the same name was added by hand.

Diagnosis commands

Which file each server_name comes from
#nginx -T 2>/dev/null | grep -nE '^# configuration file|server_name'
Look for backups and duplicate links
#ls -la /etc/nginx/sites-enabled/ /etc/nginx/conf.d/

Fix configs

Remove the duplicate site file

rm /etc/nginx/sites-enabled/example.conf.bak
nginx -t && systemctl reload nginx

Include only .conf files

# rename site files to end in .conf first (Debian's default has no extension)
http {
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*.conf;
}

Run nginx -t first, then systemctl reload nginx.

Key facts and sources

  • nginx picks a server by listen address and port first, then by server_name; with no match on that port it uses the default_server. [nginx.org]
  • nginx -T tests the configuration and dumps every loaded file. [nginx.org]

Checked against the linked pages on 2026-11-14; the official docs win if a newer nginx changes them.

FAQ

It is only a warning. Can I ignore it?

Better not. The ignored server may be the one you just edited, which looks like “my changes do nothing”.

Is one server on 80 and one on 443 a conflict?

No. The conflict is the same name on the same address and port.

Fix it with a tool

Related errors

Sponsored slot (empty)
VPS / CDN recommendations may appear here later, labelled as affiliate links. There are no referral links today.