【nginx问题】nginx: [emerg] duplicate location “/”

1、检查配置文件是否存在重复的location /{},有的话注释一个,如下图所示:

【nginx问题】nginx: [emerg] duplicate location “/”

2、如果是多个不重复的location /{},将两个location /{}合并成一个 就好了,如下所示,注释掉一个location /{}:

   location / {

        index index.php index.html index.htm;

    }

    location ~ \.php$ {

      *********

    }

    error_page 404 /404.html;
        #location = /40x.html {             
       #}