且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当一个 url 被点击时找不到 404 页面,但从索引页面上的链接打开时可以正确提供

更新时间:2023-12-02 23:45:04

必须添加以下 nginx 位置块,以便为从 redis 提供的索引文件中的子路由提供服务.可以找到详细的解释和完整的 nginx 配置 这里.

Following nginx location block has to be added in order to serve the subroutes from index file being served from redis. A detailed explanation and full nginx config can be found here.

  # This block handles the subrequest. If any subroutes are requested than this rewrite the url to root and tries to render the subroute page by passing the subroute to index file (which is served by the redis).
  location ~* / {
  rewrite ^ / last;
  }