Handshake failed due to invalid Upgrade header: null 解决方案

Posted 园芳宝贝

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Handshake failed due to invalid Upgrade header: null 解决方案相关的知识,希望对你有一定的参考价值。

解决方案,在  nginx  ,location 中添加以下红色代码:

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection  "upgrade";
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
server {
        listen 80;
        server_name localhost;
 
 
        location / {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-NginX-Proxy true;
 
                # prevents 502 bad gateway error
                proxy_buffers 8 32k;
                proxy_buffer_size 64k;
 
                proxy_pass http://127.0.0.1:8080;
                proxy_redirect off;
 
                # enables WS support
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection  "upgrade";
        }
}

 

以上是关于Handshake failed due to invalid Upgrade header: null 解决方案的主要内容,如果未能解决你的问题,请参考以下文章

Handshake failed due to invalid Upgrade header: null 解决方案

fatal: unable to access github.com schannel failed to receive handshake, SSL/TLS connection failed

Account locked due to 25 failed logins

Dubbo-Fail to decode request due to: RpcInvocation

Account locked due to 25 failed logins

failed with state FAILED due to: NA&NullPointerException