【问题标题】:Spring Zuul route strip one '/' in 'http://' of path paramSpring Zuul 路由在路径参数的“http://”中删除一个“/”
【发布时间】:2017-07-26 04:52:24
【问题描述】:

对不起,我的英语可能无法清楚地表达我的问题。

我使用thumbor 来裁剪图像,例如:http://thumbor-server/unsafe/300x200/http://192.168.99.100/images/image1.jpg

我还使用 nginx 将请求路由到 Thumbor,例如请求http://192.168.1.100/image-service/unsafe/300x200/http://192.168.99.100/images/image1.jpg 将被路由到http://thumbor-server/unsafe/300x200/http://192.168.99.100/images/image1.jpg

但由于某些原因,我不得不使用 Spring zuul 来做路由,而不是 nginx。所以我像这样配置路由过滤器:

zuul: ignored-services: '*' sensitiveHeaders: Cookie,Set-Cookie routes: image-service: path: /image-service/** url: http://thumbor-server

但是zuul路由后,thumbor无法从http://192.168.99.100/images/image1.jpg加载图片,因为图片的url在'http://'中被剥离了一个'/',所以thumor显示错误提示'http:/192.168.99.100 /images/image1.jpg' 是无效路径。

我必须通过删除图片网址中的“http://”来解决。

Zuul 有没有在路由请求的 url 中去掉 'http://' 中的 '/' 的配置?

非常感谢。

【问题讨论】:

    标签: spring spring-cloud netflix-zuul spring-cloud-netflix


    【解决方案1】:

    您似乎没有代理/images/**,您可以尝试添加以下内容: routes: images: path: /images/** stripPrefix: false url: http://thumbor-server

    【讨论】:

      猜你喜欢
      • 2016-12-23
      • 2017-06-12
      • 1970-01-01
      • 2020-10-25
      • 2020-06-01
      • 2016-09-07
      • 2017-11-09
      • 1970-01-01
      • 2017-12-02
      相关资源
      最近更新 更多