【问题标题】:Kong api gateway return 404 not found instead message : no route and no API found with those valuesKong api 网关返回 404 not found 而不是消息:没有路由,也没有找到具有这些值的 API
【发布时间】:2019-07-20 15:24:07
【问题描述】:

我使用路由http://base_url/apis/

但是当我尝试另一个网址示例http://base_url/tests/

它返回

{"message":"no route and no API found with those values"}

但我希望在访问我未指定的 url 时找不到 404

我是怎么做到的?

【问题讨论】:

    标签: api-gateway kong


    【解决方案1】:

    我还没有这样做,但是应该可以创建一个具有低 regex_priority 的“包罗万象”路由,然后您将其路由到“默认后端”类型的服务,然后该服务将回答您定义的任何内容它返回,例如404,“未找到”。

    这仅适用于 Kong 0.13.x+ 或 Kong 1.0+;我认为使用 Kong 管理 API 的 /apis API 的早期版本没有对应的东西。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-11-03
      • 1970-01-01
      • 2016-07-22
      • 2015-01-07
      • 1970-01-01
      • 1970-01-01
      • 2020-01-28
      相关资源
      最近更新 更多