【问题标题】:Nginx returns 426Nginx 返回 426
【发布时间】:2021-11-12 19:44:57
【问题描述】:

当我使用 curl 从 Nginx 服务器访问 Istio 网关 NodePort 时,我得到了正确的响应,如下所示:

curl -v "http://52.66.195.124:30408/status/200"
*   Trying 52.66.195.124:30408...
* Connected to 52.66.195.124 (52.66.195.124) port 30408 (#0)
> GET /status/200 HTTP/1.1
> Host: 52.66.195.124:30408
> User-Agent: curl/7.76.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< server: istio-envoy
< date: Sat, 18 Sep 2021 04:33:35 GMT
< content-type: text/html; charset=utf-8
< access-control-allow-origin: *
< access-control-allow-credentials: true
< content-length: 0
< x-envoy-upstream-service-time: 2
< 
* Connection #0 to host 52.66.195.124 left intact

当我像下面这样通过 Nginx 代理进行配置时,我通过域获取HTTP ERROR 426

注意:我的域是 HTTPS - https://dashboard.example.com

server {
        server_name dashboard.example.com;
        location / {
               proxy_pass       http://52.66.195.124:30408;
        }
}

谁能帮我理解这个问题?

【问题讨论】:

    标签: nginx kubernetes istio-gateway


    【解决方案1】:

    HTTP 426 错误表示upgrade required:

    服务器拒绝使用当前协议执行请求,但在客户端升级到不同协议后可能愿意这样做。

    another info:

    HTTP 426 Upgrade Required 客户端错误响应代码表示服务器拒绝使用当前协议执行请求,但在客户端升级到不同协议后可能愿意这样做。 p>

    在您的情况下,您需要检查您使用的 HTTP 协议的版本。好像太低了。看看this thread。在这种情况下,您必须从 1.0 升级到 1.1

    您需要在 NGINX 配置中升级您的 HTTP 协议版本,如下所示:

    此路由用于旧版 API,出于性能原因启用了 NGINX 缓存,但在此路由的代理配置中,它错过了共享配置 proxy_http_version 1.1,默认为所有 NGINX 上游使用 HTTP 1.0。

    如果请求是HTTP 1.0,Envoy 将返回HTTP 426

    【讨论】:

      猜你喜欢
      • 2021-11-03
      • 2021-12-23
      • 2016-07-30
      • 2023-02-15
      • 1970-01-01
      • 2017-06-09
      • 2016-10-20
      • 2015-10-12
      • 1970-01-01
      相关资源
      最近更新 更多