spring - 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调用而只是页面重定向?
解决方案
推荐阅读
- scala - 什么是 sbt 存储库
- protractor - Unable to debug angular e2e tests with Protractor in VS-Code
- laravel - BadMethodCallException Call to undefined method App\Student::generateToken()
- sql-server - How to Fake tables from other database in tsqlt?
- php - How to take screen shot of a web page in PHP and show it in model popup and submit it into database
- django - 添加包时的 Python 诗歌 [EnvCommandError]
- php - How to redirect multiple files in same directory using nginx?
- c# - 如何在使用 where 子句时使用快照
- c# - 多个触发器在 Quartz.NET 中不起作用
- javascript - 如何使用 Google Maps Javascript API 绘图库复制和缩放形状?