React-router v4 Jump to external url

The

react-router code is as follows. The Login corresponding to / login is a separate login component, and the Wxbusiness corresponding to / wxbusiness is the main business logic component. All mismatched components will request the NotFound component.

render() {
    return (
      <BrowserRouter>
        <Switch>
          <Route exact path="/login" component={Login} />
          <AuthRouter path="/wxbusiness" component={Wxbusiness} />
          <Route
            exact
            path="/"
            render={() => <Redirect to="/wxbusiness/index" replace />}
          />
          <Route component={NotFound} />
        </Switch>
      </BrowserRouter>
    );
  }

deployment method: react is compiled through webpack and deployed to nginx, and the / directory of nginx points to the directory compiled by react (/ app/wxbusiness/html).
where the directory corresponding to / doc is the directory of gitbook, which stores documents and the like, and has nothing to do with the react project.
below is part of the configuration of nginx (multiple rewrite matching patterns have been tried, but the problem remains).

location / {
    root /app/wxbusiness/html;
    index index.html;
    try_files $uri /index.html;
}
location /doc {
    alias /app/wxbusiness/doc/_book;
    try_files $uri /doc;
}

question : let"s assume that the domain name is https://www.test.com statement project with a link written under the wxbusiness component (see the following code for details). When the user clicks on the link, it jumps to https://www.test.com/doc, but now returns 404.
tried to analyze it himself, thinking that when clicking the a link to jump, the route was not requested to nginx, but the route was digested inside react-router, because it did not match / login and / wxbusiness (the Route part tried to add a route of / doc, which did not prompt 404, but the page was blank), so 404
how to solve this problem? Thank you in advance

const docurl = "https://" + window.location.hostname + "/doc";
window.location.href = docurl;
return;
Menu