location / {
    index index.html index.htm;
    try_files $uri $uri/ /index.html;
}

#或者
location / {                
    index  index.html index.htm;
    try_files $uri $uri/ @router;
}        
location @router {
    rewrite ^.*$ /index.html last;
}