解决Nginx下,页面刷新,React-router出现404问题

Nginx server 配置如下:

1
2
3
4
5
6
7
8
9
server {
listen 80;
server_name app.handsomehan.cn;
index index.html;
root /data/web/flower/;
location / {
try_files $uri $uri /index.html;
}
}