`nginx -t` yields this notice: duplicate default server


#1

Ref:

@MiteshShah Notice: the server does run, but since you asked here’s the output This the notice I said no to nginx.conf and www.conf alteration :

root@traffic:~# nginx -t
nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/traffic.mg:5
nginx: configuration file /etc/nginx/nginx.conf test failed

Also note this a Multisite with domain mapping. If I: nano /etc/nginx/sites-enabled/traffic.mg and look at line 4 and 5 :

    # Uncomment The Following Line For Domain Mapping
     listen 80 default_server;

This was part of your instruction to uncomment for domain mapping - is this where the duplicate default server is


#2

@yoyoadmin

ee site edit traffic.mg

and change listen 80 default_server; to listen 80; and then test nginx using nginx -t


#3

good solution to fix the config complaint, but my subdomains no longer map @harshadyeola Thank you sir : )


#4

All single site installs are great

The multisite installation has broken subdomain mapping. traffic.mg is the base install

http://thedunwells.traffic.mg should map to http://thedunwells.com and it does, but I see the nginx notice…

Aarrrgh, I’m stuck!


#5

Temporary solution

By adding my domains manually like this it works, but not very handy method if you’re adding domains from the front end - any thoughts?

ee site edit traffic.mg
server_name traffic.mg *.traffic.mg thedunwells.com loslonelyboys.com iloveyousomuch.co playingintrafficrecords.com;

#6

I had to manually add www to all mapped domain as well as such

# Uncomment The Following Line For Domain Mapping
         listen 80;

        server_name traffic.mg *.traffic.mg thedunwells.com www.thedunwells.com loslonelyboys.com www.loslonelyboys.com iloveyousomuch.co www.iloveyousomuch.co playingintrafficrecords.com www.playingintrafficrecords.com;

#7

Hi @yoyoadmin

In case of wp multisite subomains there are a few things to keep in mind :

you can have multiple wp mutisite sudomains on same server giventhat -->

  • server have multiple IP’s

  • bind one mu to one ip

You must keep listen 80 default_server; in your mu’s nginx config and remove it other config which is causing duplicate default_server issue so you don’t have to do work in vhost’s nginx config for every subdomain mapping that you do using the mapping plugin.


#8

Hi @yoyoadmin

It’s been a long time, and we haven’t heard from you. It looks like your issue is resolved.

I am closing this support topic for now. Feel free to create a new support topic if you have any queries further. :slight_smile:


#9