Nginx 返回 426

Rah*_*nan 8 nginx kubernetes istio-gateway

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

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
Run Code Online (Sandbox Code Playgroud)

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

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

server {
        server_name dashboard.example.com;
        location / {
               proxy_pass       http://52.66.195.124:30408;
        }
}
Run Code Online (Sandbox Code Playgroud)

谁能帮助我理解这个问题?

Mik*_*iak 9

HTTP 426 错误意味着需要升级

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

其他信息

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

根据您的情况,您需要检查您正在使用的 HTTP 协议版本。看来太低了。看看这个线程。在这种情况下,您必须从 升级1.01.1.

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

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

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