In my error log i get
[emerg] 10619#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/mysite.com:4
on Line 4 I have:
server_name mysite.com www.mysite.com;
Any suggestions?
In my error log i get
[emerg] 10619#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/mysite.com:4
on Line 4 I have:
server_name mysite.com www.mysite.com;
Any suggestions?
You likely have other files (such as the
default
configuration) located in/etc/nginx/sites-enabled
that needs to be removed.This issue is caused by a repeat of the
default_server
parameter supplied to one or morelisten
directives in your files. You'll likely find this conflicting directive reads something similar to:As the nginx core module documentation for
listen
states:This means that there must be another file or
server
block defined in your configuration withdefault_server
set for port 80. nginx is encountering that first before yourmysite.com
file so try removing or adjusting that other configuration.If you are struggling to find where these directives and parameters are set, try a search like so:
If you're on Digital Ocean this means you need to go to /etc/nginx/sites-enabled/ and then REMOVE using rm -R digitalocean and default
It fixed it for me!
Pic of Console on Windows 10 using Bitvise
Execute this at the terminal to see conflicting configurations listening to the same port:
OS Debian 10 + nginx. In my case, i unlinked the "default" page as: