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 (将#修改为@)