Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 2 files. The default:

/etc/nginx/sites-enabled/default

server {

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

I then have a custom file:

/etc/nginx/nginx.conf

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
1  
grep -lr default /etc/nginx? –  quanta Sep 11 '12 at 3:30

2 Answers 2

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

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

Your Answer

 
discard

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.