<p>i have a service that name is <code>image-api</code>. the image-api is accessible in pod but nginx return 426 status code</p>
<p>after running this command return the expected data</p>
<pre><code>curl image-api.gateways.svc.cluster.local:8000
</code></pre>
<p>but nginx return 426 status code.</p>
<p>if replace the native url of image-api by istio url then nginx return 200 status code.</p>
<p>the <code>/etc/nginx.nginx.conf</code></p>
<pre><code>worker_processes 8;

events {
    worker_connections 1024;
}

http {
    resolver kube-dns.kube-system valid=10s;

    server_tokens off;

    server {
        listen 8080;

        location ~ ^/(\w+) {
            # ISTIO URL
        proxy_pass http://image-api.gateways.svc.cluster.local:8000$request_uri;
            # MAIN URL
#       proxy_pass http://image-api.main.svc.cluster.local:8000$request_uri;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }
}
</code></pre>

Arman
<p>As mentioned in the <a href="https://httpstatuses.com/426" rel="nofollow noreferrer">document</a>:</p>
<blockquote>
<p>A 426 status code is caused when a client is attempting to upgrade a
connection to a newer version of a protocol, but the server is
refusing to do so.</p>
<p>This can happen for several reasons, including:</p>
<ol>
<li><p>Incompatibility between the client and server versions of the protocol.</p>
</li>
<li><p>The server may not support the requested version of the protocol.</p>
</li>
<li><p>The server may be configured to only allow certain versions of the protocol to be used.</p>
</li>
<li><p>The server may be experiencing technical issues or undergoing maintenance that prevents it from upgrading the connection.</p>
</li>
</ol>
</blockquote>
<p>You need to upgrade your HTTP protocol version in NGINX config like there:</p>
<p>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 <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version" rel="nofollow noreferrer">proxy_http_version 1.1</a>, which default to use HTTP 1.0 for all NGINX upstream.</p>
<p>And Envoy will return HTTP 426 if the request is HTTP 1.0.</p>
