码迷,mamicode.com
首页 > Web开发 > 详细

websocket:日常总结

时间:2018-08-27 23:18:24      阅读:241      评论:0      收藏:0      [点我收藏+]

标签:invalid   color   eal   page   nec   日常   ati   char   blog   

1.报错:DefaultHandshakeHandler : Handshake failed due to invalid Upgrade header

参考文章:https://www.cnblogs.com/interdrp/p/7729718.html

在nginx中添加蓝色配置:

server {
        listen       80;
        server_name  test.jxt.com;
        charset utf-8;
        access_log  logs/jxt.access.log  main;
        location / {
            #root   html;
            #index  index.html index.htm;
            proxy_pass http://jxt;
            proxy_set_header Host      $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection  "upgrade";
        }
        #error_page  404              /404.html;
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

websocket:日常总结

标签:invalid   color   eal   page   nec   日常   ati   char   blog   

原文地址:https://www.cnblogs.com/huiy/p/9545184.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!