Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 files. The default:


server {

        listen   80; ## listen for ipv4
        listen   [::]:80 default ipv6only=on; ## listen for ipv6 << LINE 10

I then have a custom file:


http {
    server {
        server_name mydomain;
        listen 3000;
        root /projects/myproject/public;

When I try to restart the service I receive this error:

the duplicate default server in /etc/nginx/sites-enabled/default:10
configuration file /etc/nginx/nginx.conf test failed

I have minimal experience with nginx and was hoping somebody could point out where I might have gone wrong?

share|improve this question
grep -lr default /etc/nginx? – quanta Sep 11 '12 at 3:30
@quanta Thank you sir. – radev Apr 21 '15 at 22:47

8 months late, but anyway...

I had the same problem - it turned out that my editor left a default~ backup file behind after I had edited default. Nginx read both the backup and the edited version and of course found a discrepancy between the two. Simply deleting the backup allowed Nginx to start.

share|improve this answer

In my case I updated both GitLab and the Ubuntu server to 14.04. That apparently made nginx to get a new default config file. Just deleted it keeping the gitlab config made it happy again.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.