这个
^/$
与uri不匹配
/12345678
-它只匹配uri
/
.
您可以使用:
rewrite ^ /index.html break;
这个
^
只是许多匹配任何事物的正则表达式之一。这个
break
后缀导致重写的uri在同一个
location
封锁。见
this document
详细情况。
您可以使用
try_files
指令:
location ~ "^/[\d]{8}" {
root /usr/share/nginx/html;
try_files /index.html =404;
}
这个
=404
从句从未达到
index.html
一直存在-但是
试用文件
必须至少有两个参数。见
this document
详细情况。