在nginx配置文件中加入这段配置

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