nginx- duplicate default server error

后端 未结 5 2006
梦毁少年i
梦毁少年i 2021-01-30 12:32

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

5条回答
  •  天涯浪人
    2021-01-30 12:52

    In my case junk files from editor caused the problem. I had a config as below:

    #...
    http {
     # ...
     include ../sites/*;
    }
    

    In the ../sites directory initially I had a default.config file. However, by mistake I saved duplicate files as default.config.save and default.config.save.1. Removing them resolved the issue.

提交回复
热议问题