如何在安全Nginx上修复“从上游读取响应头时上游过早关闭连接”

2024-04-23 07:21:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我配置我的nginx:

user root;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent"';

server {
        listen 80 ssl http2;

        ssl_certificate     MY_PATH/ssl_truststore.pem;
        ssl_certificate_key MY_PATH/ssl_keystore.pem;
        ssl_password_file /root/passwd;

        server_name my-server-name;

        access_log logs/access.log main;

        location / {
            # Replace localhost:50051 with the address and port of your gRPC server
            # The 'grpc://' prefix is optional; unencrypted gRPC is the default
            grpc_pass grpc://my-server-name:1234;
        }
    }
}

我想为SSL grpc服务器配置安全nginx L7负载平衡。在非安全grpc服务器上,非安全nginx工作正常。但在secure上我遇到了一个错误:

^{pr2}$

我试图找到解决这个问题的办法,但没有一个适合我。在


Tags: nameloghttpsslgrpcserverremotemain