【问题标题】:Upstream http and https protocol under one upstream一个上游下的上游http和https协议
【发布时间】:2021-03-10 08:55:53
【问题描述】:

我一直在尝试在一个上游添加两个目标,一个是 HTTP,另一个是 HTTPS。我不知道如何实现这一点,我尝试添加目标,例如:https:10.32.9.123:443 但这不起作用。

目标可能位于 HTTP 或 HTTPS 上似乎存在限制,是否有解决方法。我的 kong 配置文件如下所示:

_format_version: "2.1"

_transform: true

services:
- name: test-server-public
  protocol: http
  host: test-endpoint-upstream
  port: 8000
  retries: 3
  connect_timeout: 5000
  routes:
  - name: test-route
    paths:
    - /test
upstreams:
- name: test-endpoint-upstream
  targets:
  - target: target-url:8080
    weight: 999
  - target: target-https-url:443
    weight: 1
  healthchecks:
    active:
      concurrency: 2
      http_path: /
      type: http
      healthy:
        interval: 0
        successes: 1
        http_statuses:
        - 200
        - 302
      unhealthy:
        http_failures: 3
        interval: 10
        tcp_failures: 3
        timeouts: 3
        http_statuses:
        - 429
        - 404
        - 500
        - 501
        - 502
        - 503
        - 504
        - 505
    passive:
      type: http
      healthy:
        successes: 1
        http_statuses:
        - 200
        - 201
        - 202
        - 203
        - 204
        - 205
        - 206
        - 207
        - 208
        - 226
        - 300
        - 301
        - 302
        - 303
        - 304
        - 305
        - 306
        - 307
        - 308
      unhealthy:
        http_failures: 1
        tcp_failures: 1
        timeouts: 1
        http_statuses:
        - 429
        - 500
        - 503
  slots: 1000

【问题讨论】:

    标签: nginx kong


    【解决方案1】:

    没有解决办法。

    您应该在您的网络服务器配置中设置将 http 重定向到 https。

    This http-to-https-redirect plugin 将对您的情况有所帮助。

    【讨论】:

      猜你喜欢
      • 2021-02-10
      • 2015-05-18
      • 1970-01-01
      • 1970-01-01
      • 2011-02-13
      • 2020-12-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多