当我们尝试像localhost/page1
这样的直接URL时,找不到nginx抛出404页面。
我们正在使用react-router,webpack和nginx。
在我们尝试过的nginx配置中
location /{
try_files $uri index.html;
}
location /{
try_files $uri $uri/ =404;
}
location /{
try_files $uri $uri/ index.html;
}
这是我的webpack配置
devserver: {
historyApiFallback: true,host : '0.0.0.0'
},
但没有任何效果, 我在这里想念什么吗?