Nginx Subdomain/Staging Server conflicting server name

1.3k views Asked by At

Hi I am trying to configure a server and its subdomain with nginx but the nginx shows conflicting servername. I have tried these settings. Can anyone suggest how can i configure subdomain with nginx? I am getting error:

nginx: [warn] conflicting server name ":" on 0.0.0.0:3000, ignored

server{
listen 3000;
server_name : www.website.com website.com;
......
}
server{
listen 3000;
server_name : www.staging.website.com staging.website.com;
......
}
1

There are 1 answers

1
kuba_ceg On BEST ANSWER

Should be:

server{
listen 3000;
server_name www.website.com website.com;
......
}
server{
listen 3000;
server_name www.staging.website.com staging.website.com;
......
}

without colon.