【问题标题】:Can not set Upstream path to service in Kong Db-less mode无法在 Kong Db-less 模式下设置服务的上游路径
【发布时间】:2022-01-01 16:55:26
【问题描述】:

我在无 Db 模式下使用 Kong。我首先使用yaml config文件来配置服务,在doc中定义,像这样:

_format_version: "2.1"
_transform: true


services:
  - name: controllers
    url: https://10.5.131.142:3002
    routes:
    - name: controller-routes
      paths:
      - /admin/controllers 

  - name: vpnprofiles
    url: https://10.5.131.142:3002
    routes:
    - name: vpnprofiles-routes
      paths:
      - /admin/vpnprofiles

  - name: device_report
    url: https://10.5.131.142:3000
    routes:
    - name: device-report-routes
      paths:
      - /reporting/device_report

但是,这不会设置用于向上游服务请求的路径。查看该字段时,它返回为 null。 我尝试使用 /config 端点重置配置,但未考虑“路径”字段。它不会被拒绝,但它不会更新字段。

有没有办法设置上游服务的路径?

【问题讨论】:

    标签: kong


    【解决方案1】:

    我终于发现要直接在url字段上设置,kong yaml config文件中没有path字段。

    【讨论】:

      猜你喜欢
      • 2020-04-19
      • 2020-11-10
      • 2013-12-16
      • 1970-01-01
      • 2021-07-09
      • 2019-12-26
      • 1970-01-01
      • 2018-03-31
      • 1970-01-01
      相关资源
      最近更新 更多