反应路由器刷新提高404

时间:2019-04-02 05:55:38

标签: reactjs nginx react-router nginx-config

我想使用react-router连接React网页(在/service/backoffice中)。访问/backoffice时,可以使用/backoffice/login,但是/backoffice/login刷新(F5)会引发404 Not Found。

我应该在nginx.conf中修复它吗?

nginx.conf下面:

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  aaa.com;

        include /etc/nginx/default.d/*.conf;

        location / {
            proxy_pass  http://127.0.0.1:8080;
        }

        location /backoffice {
           alias /service/backoffice;
           #try_files $uri /index.html;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

0 个答案:

没有答案