server {
listen 2024;
server_name localhost;
location / {
root C:app/dist;
index index.html;
try_files $uri $uri/ /index.html;
}
}
try_files $uri $uri/ /index.html;
可以默认将访问指向到index.html.对于history模式的路由很有用。