Question

Conflicting server name "mydomain.com" on 0.0.0.0:80, ignored NGINX error log Ubuntu 20.04

Hello, when I check the nginx error log I notice that alert and I don’t know why, I cannot access my website from http or https, my DNS in cloudflare are:

A - mydomain.com - MY IP
CNAME - www - mydomain.com

The 4 last lines of the log:

2020/10/12 07:03:22 [notice] 15705#15705: signal process started
2020/10/12 07:18:50 [warn] 15818#15818: conflicting server name "mydomain.com" on 0.0.0.0:80, ignored
2020/10/12 07:18:50 [warn] 15818#15818: conflicting server name "www.mydomain.com" on 0.0.0.0:80, ignored
2020/10/12 07:54:16 [notice] 16047#16047: signal process started

Any help please?


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

6
Bobby Iliev
Site Moderator
Site Moderator badge
October 12, 2020
Accepted Answer

Hi there @hcmendez,

It most likely means that you have your mydomain.com domain specified in multiple Nginx server blocks.

What you could do is use the grep command and search for the mydomain.com domain inside your /etc/nginx/sites-enabled folder:

  1. grep -r mydomain.com /etc/nginx/sites-enabled

If you see the domain name in more than server blocks for port 80, you would need to remove the duplicate one and then restart Nginx.

Hope that this helps! Regards, Bobby

Thanks for the answer, i’m typing the command but nothing happens. I have changed the mydomain.com with my real domain but nothing.

Bobby Iliev
Site Moderator
Site Moderator badge
October 13, 2020

Hello,

In this case, can you share the content of your Nginx server blocks here?

Regards, Bobby

same is happening to me, what to do when I need to host multiple sites on several created server blocks in /etc/nginx/sites-available/

ps. all my domains in cloudflare

Buddy,You can create multiple html files like me, one html represents one page

Wow, thanks a ton. I read over this and thought “there’s absolutely no way I’m specifying multiple domains, I’ve been over my files multiple times” but ran it anyways. It looks like certbot for whatever reason decided to overwrite my default site server_name with a new site I’d created in a separate file…? Likely because I was using an older version with bugs

Just so that everybody is aware, you’ll likely have to include a wildcard in the search for it to return results:

grep -r mydomain.com /etc/nginx/sites-enabled/*
Bobby Iliev
Site Moderator
Site Moderator badge
August 8, 2021

Hi there,

Happy to hear that you’ve got it all working! Thank you for including this additional information here!

Hello, I just had the same problem and used the code snippet to find my IP showed red (meaning it’s on server blocks). How do I remove it. There is only one place i kept the IP

Please see my configuration: dir: /etc/nginx/sites-enalbed/clouditech

code

server {  
	listen 80;     
	server_name 137.184.69.187;    
	location = /favicon.ico { access_log off; log_not_found off; }    
	location /static/ {         
		root /root/clouditech_project;     
	}    
	location / {         
		include proxy_params;         
		proxy_pass http://unix:/run/gunicorn.sock;     
	}
}


thanks

That is really useful , help me so much that I sign up a account to say that Thank you very much !

Bobby Iliev
Site Moderator
Site Moderator badge
October 1, 2021

No problem at all @xinge666qwd! Happy to hear that this helped!

Thanks for the answers, I deployed another droplet with Open LiteSpeed. Everything is good now, thanks.

In my case I had created another entry in /etc/nginx/conf.d/virtual.conf, from a previous guide.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.