首页 > 其他 > 详细

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

时间:2018-01-02 11:15:54      阅读:1830      评论:0      收藏:0      [点我收藏+]

解决方案,在  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 解决方案

原文:https://www.cnblogs.com/gmq-sh/p/8169758.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!