將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 {
}