在nginx对应的网站conf文件里添加以下配置:
location / {
root /www/wwwroot/xxx.com/; #项目路径
index /index.html;
try_files $uri $uri/ /index.html; #匹配不到任何静态资源,跳到同一个index.html
}
在nginx对应的网站conf文件里添加以下配置:
location / {
root /www/wwwroot/xxx.com/; #项目路径
index /index.html;
try_files $uri $uri/ /index.html; #匹配不到任何静态资源,跳到同一个index.html
}
转载于:https://my.oschina.net/junko2013/blog/3020950