nginx配置出錯duplicate location “/”nginx: [emerg] duplicate 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 {
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章