技术解析
client 报错:
UNAVAILABLE: HTTP status code 502
nginx 日志:
upstream sent too large http2 frame: 1377025 while reading response header from upstream, client: 127.0.0.1, server: hsltest.org1.peer0, request: "POST /protos.Events/Chat HTTP/2.0"
nginx 配置如下
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $upstream_addr - [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "-" "$host"';
access_log logs/http.access.log;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 240;
grpc_buffer_size 8m;
http2_max_field_size 2m;
http2_max_header_size 2m;
大带宽服务器
proxy_buffer_size 2m;
proxy_buffers 4 2m;
proxy_busy_buffers_size 2m;
http2_recv_buffer_size 2m;
http2_chunk_size 2m;
server_names_hash_bucket_size 128;
ssl on;
ssl_certificate ssh/org1.peer0.tls.cer;
ssl_certificate_key ssh/org1.peer0.tls.key;
ssl_client_certificate ssh/org1.tlsca.cer;
ssl_verify_client on;
server {
listen 1051 ssl http2;
server_name hsltest.org1.peer0;
location / {
grpc_pass grpc://192.168.235.128:1051;
}
}
}