server {
listen 8000;
server_name localhost;
#以下两点是关键
location / {
root html;
index index.html index.htm;
try_files $uri $uri/ @req;
}
location @req {
rewrite ^.*$ /index.html last;
}