【发布时间】:2019-11-11 08:39:18
【问题描述】:
当我们尝试像localhost/page1这样的直接网址时,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'
},
但没有任何效果, 我在这里有什么遗漏吗?
【问题讨论】:
标签: nginx webpack react-router