如何解决NGINX不显示React页面
我有一个使用React-Router,NodeJs和MongoDB的Web应用程序。我正在尝试将其放在NGINX上,但是当我启动NGINX时,它不会显示我的网页。
这些是我的反应路由器:
<BrowserRouter>
<Route path="/home" exact component={Home}/>
<Route path="/graph/:id" component={Graph}/>
</BrowserRouter>
这是我的NGINX配置文件:
server {
listen 80;
root /opt/applications/dashboard/frontend/build;
index index.html index.htm;
# Any route that doesn't have a file extension (e.g. /devices)
location /home{
try_files $uri /index.html;
}
我在做什么错了?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。