Nginx returns 426

9/18/2021

When I am accessing a Istio gateway NodePort from the Nginx server using curl, I am getting response properly, like below:

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

The same when I am configuring through Nginx proxy like below, I am getting HTTP ERROR 426 through the domain.

Note: my domain is HTTPS - https://dashboard.example.com

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

Can anyone help me to understand the issue?

-- Rahul Radhakrishnan
istio-gateway
kubernetes
nginx

1 Answer

9/20/2021

HTTP 426 error means upgrade required:

The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.

or another info:

The HTTP 426 Upgrade Required client error response code indicates that the server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.

In your situation, you need to check what version of the HTTP protocol you are using. It seems too low. Look at this thread. In that case, you had to upgrade from 1.0 to 1.1.

You need to upgrade your HTTP protocol version in NGINX config like there:

This route is for a legacy API, which enabled NGINX cache for performance reason, but in this route's proxy config, it missed a shared config proxy_http_version 1.1, which default to use HTTP 1.0 for all NGINX upstream.

And Envoy will return HTTP 426 if the request is HTTP 1.0.

-- Mikołaj Głodziak
Source: StackOverflow