首页 > 解决方案 > React 路由器在 nginx 中无法正常工作

问题描述

React 路由器在 URL 中使用一个额外的参数,但是当添加另一个参数(如 /panel-admin/dashboard)不起作用时,我添加了这个代码

 location / {
           try_files $uri /index.html;
        }

但不起作用

标签: reactjsnginx

解决方案


也许试试这个?

location / {
    try_files $uri $uri/ /index.html;
}

推荐阅读