Tonic: NGINX as a reverse proxy fails keep alive

Created on 27 Mar 2020  路  4Comments  路  Source: hyperium/tonic

Bug Report

Version

tonic: v0.1.1

Platform

debian

Description

I came across this when working with nginx as a reverse proxy in front of a tonic server. Though, I don't think this is specific to nginx. We have a reverse proxy to do tls termination and routing within a kubernetes cluster to a tonic server. However it intermittently fails with 502 errors. The errors in nginx points to lack of support for SETTINGS_HEADER_TABLE_SIZE from the http2 specification.

A snippet of the comment from the nginx bug:

nginx explicitly announces that it does not support dynamic header compression by sending the SETTINGS_HEADER_TABLE_SIZE value set to 0, see 鈥媓ere.

https://trac.nginx.org/nginx/ticket/1538#ticket

Here's the http2 specification for SETTINGS_HEADER_TABLE_SIZE: https://tools.ietf.org/html/rfc7540#section-6.5.1

So I think any client that doesn't support dynamic header compression will run into this same issue.

The error we're seeing in nginx is " upstream sent invalid http2 table index: 63 while reading response header from upstream" which pointed me to this issue: https://github.com/kubernetes/ingress-nginx/issues/2405

Which references the fix that the go grpc server implemented: https://github.com/grpc/grpc-go/pull/2045/files

Most helpful comment

All 4 comments

cc @seanmonstar ^ seems hyper/h2 related.

We've updated our h2 crate to 0.2.4 and verified that issue is no longer occurring with nginx! :confetti_ball:

Thanks so much! I really appreciate it.

@rokadias great thank you for the quick feedback!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ebkalderon picture ebkalderon  路  5Comments

LucioFranco picture LucioFranco  路  6Comments

matthauck picture matthauck  路  6Comments

xmclark picture xmclark  路  10Comments

LucioFranco picture LucioFranco  路  6Comments