【问题标题】:Whitelabel Error Page This application has no explicit mapping for /error time outWhitelabel 错误页面 此应用程序没有 /error 超时的显式映射
【发布时间】:2016-10-26 06:08:12
【问题描述】:

我对 zuul 完全陌生,但由于我们对配置进行了一些更改,我面临着一个我似乎无法克服的挑战。

在这种情况下,Zuul 仅用于重写一些 url,仅此而已。它在各种其他环境中都可以正常工作,并且在我们进行这些更改之前一直可以在这个环境中工作。

zuul 配置看起来像这样..

spring:
  profiles: development
zuul:
  routes:
    fakebank:
          path: /fake-bank/rest/projects/fakebank/**
          url:  https://dev-fakebank-api.fkebnk.com/office-365/rest
    fakebank2:
          path: /rest/projects/fakebank/**
          url:  https://dev-fakebank-api.fkebnk.com/office-365/res

但是,当我访问要重写的 URL 时,例如 https://dev-api.fakebank.com/fake-bank/rest/projects/fake-bank/health-check,我只是不断收到以下错误:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Jun 23 17:48:24 UTC 2016
There was an unexpected error (type=Internal Server Error, status=500).
connect timed out

有没有人有任何想法或可以为我指出一个开始走路的好方向?

提前致谢。

【问题讨论】:

    标签: url-rewriting netflix-zuul http-status-code-500


    【解决方案1】:

    我设法自己解决了这个问题,并想我会在这里发布答案供其他人使用。

    最后,re-write配置出错了。有点。 我注意到没有 SSL 配置可用于 tomcat 服务器。所以将https更改为http解决了这个问题。我想如果我要在 tomcat 实例上设置 SSL,它可能会开始工作。如果我想使用 SSL,我会再次更改 URL 以包含端口 443,如下例所示。

    例子:

    spring: 
    profiles: development 
    zuul: 
    routes: 
    fakebank: path: /fake-bank/rest/projects/fakebank/** 
    
    - url: https:// dev-fakebank-api.fkebnk.com/office-365/rest 
    (Non-SSL)
    + url: http:// dev-fakebank-api.fkebnk.com/office-365/rest 
    Or (if I setup SSL)
    + url: https:// dev-fakebank-api.fkebnk.com:443/office-365/rest 
    
    fakebank2: path: /rest/projects/fakebank/** 
    - url: https:// dev-fakebank-api.fkebnk.com/office-365/res
    (Non-SSL)
    + url: http:// dev-fakebank-api.fkebnk.com/office-365/res
    Or (if I setup SSL)
    + url: https:// dev-fakebank-api.fkebnk.com:443/office-365/res
    

    希望这可以帮助遇到这种情况的其他人。

    谢谢,

    【讨论】:

      猜你喜欢
      • 2019-05-23
      • 2019-11-10
      • 2019-01-13
      • 2020-05-11
      • 1970-01-01
      • 2019-01-26
      • 2020-10-26
      • 2015-09-17
      相关资源
      最近更新 更多