当直接从页面入口路由逐个点击链接时,没问题

当在当前页面刷新浏览器页面时情况如下

- 原因
nginx会试图在/react/test/snacks目录下找index.html,404是肯定的。此时需要设置一个代理如下
location / {
root "D:/测试";
index index.html index.htm;
}
location /react/test/ {
try_files $uri /react/test/index.html;
root "D:/测试";
}
参考地址: http://yjph83.iteye.com/blog/2311687