Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx returns 426

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 ?

like image 951
Rahul Radhakrishnan Avatar asked May 20 '26 23:05

Rahul Radhakrishnan


1 Answers

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.

like image 156
Mikołaj Głodziak Avatar answered May 22 '26 18:05

Mikołaj Głodziak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!