【发布时间】:2021-01-22 07:06:34
【问题描述】:
我有一个从 Spring Gateway 路由的 Angular 应用程序。根路由正常工作,但是当您深入嵌套路由时,它返回未找到状态。在Angular docs 和这个tutorial 上说你必须重写任何未找到的路由到 /index.html 但我在 Spring Cloud Gateway 文档中没有找到任何关于如何配置它的参考。
application.yml
- id: teams-frontend
uri: lb://teams-frontend
predicates:
- Path=/teams,/teams/**
filters:
- StripPrefix=1
# - RewritePath=/.*, /index.html ## This breaks existing link resources such as the scripts linked on the index.html
angular 应用找不到时如何回退到 index.html?
【问题讨论】: