天天看点

nginx配置出错duplicate location “/”nginx: [emerg] duplicate location “/”location / { 这个注释掉,即可}

将nginx配置文件中的两个location合并成一个 就好了。

server {

listen      ******;
    listen       *****;
    server_name  ****;
    root         /*****;

   

   location / {
        index index.php index.html index.htm;
    }
    
    location ~ .php$ {
      *********
    }
           

location / { 这个注释掉,即可

}

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