Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect SETTINGS_HEADER_TABLE_SIZE http2 setting #4635

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

Yurunsoft
Copy link
Member

My nginx config:

upstream grpcServer {
    server host.docker.internal:13009;
    keepalive 3600;
}

server { 
    listen       8890 http2;

    access_log  /var/log/nginx/test.access.log  main;
    error_log  /var/log/nginx/test.error.log  error;

    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';

    # grpc
    location ~* ^/(.+)\.(.+)/(.+)$ {
		grpc_set_header Host $host;
		grpc_set_header X-Real-IP $remote_addr;
		grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		grpc_socket_keepalive on;
		proxy_next_upstream off;
        grpc_pass grpc://grpcServer;
    }

    location / {
        index index.html index.htm;
        root /var/www/;
    }

    gzip on;
    gzip_min_length 1k;
    gzip_comp_level 2;
    gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
    gzip_vary on;
}

Error log:

2022/02/28 13:07:34 [error] 22#22: *1 upstream sent invalid http2 table index: 67 while reading response header from upstream, client: 172.23.0.1, server: , request: "POST /grpc.GrpcService/login HTTP/2.0", upstream: "grpc://192.168.65.2:13009", host: "localhost:8890"
2022/02/28 13:07:34 [error] 22#22: *1 upstream sent invalid header while reading response header from upstream, client: 172.23.0.1, server: , request: "POST /grpc.GrpcService/login HTTP/2.0", upstream: "grpc://192.168.65.2:13009", host: "localhost:8890"

Reference:
https://trac.nginx.org/nginx/ticket/1538
grpc/grpc-go#2045

@codecov
Copy link

codecov bot commented Feb 28, 2022

Codecov Report

Merging #4635 (67ede62) into 4.8.x (247beb4) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##            4.8.x    #4635      +/-   ##
==========================================
+ Coverage   52.71%   52.72%   +0.01%     
==========================================
  Files          73       73              
  Lines       14914    14914              
==========================================
+ Hits         7862     7864       +2     
+ Misses       7052     7050       -2     
Impacted Files Coverage Δ
src/network/client.cc 46.46% <0.00%> (-0.46%) ⬇️
src/os/async_thread.cc 72.10% <0.00%> (+0.85%) ⬆️
src/protocol/base.cc 64.45% <0.00%> (+1.80%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 247beb4...67ede62. Read the comment docs.

@matyhtf matyhtf merged commit 4b1600e into swoole:4.8.x Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants