首页 > 解决方案 > Spring Cloud Gateway 静态文件

问题描述

我遇到了这个问题,我使用 Spring Cloud Gateway 重定向到带有完整 url 的前端应用程序。

因此,当应用程序开始加载时,没有静态文件,因为它试图在我的网关基本 url 而不是实际的站点 url 下找到它们。

这可以解决吗?

例子:

网关端口:
http://localhost:9000

外部站点的路由:
http://localhost:9000/somesite

网站网址:
http://somesite/something/

因此,当站点通过网关加载时,它会要求以下静态文件:

http://localhost:9000/somesite/style.css,而不是http://somesite/something/style.css

我是否应该为此使用spring cloud gateway,因为它不是API调用而只是页面重定向?

标签: springgateway

解决方案


推荐阅读