遇到nginx报错:websocket wss failed: Error during WebSocket handshake: Unexpected response code: 403

  server {
listen 6340;
location / {
proxy_pass http://web;
proxy_http_version 1.1; #Nginx在与Node后端通信时使用HTTP/1.1,是WebSockets所必需的
proxy_set_header Origin '';
proxy_set_header Upgrade $http_upgrade; #Nginx响应升级请求,当浏览器想要使用WebSocket时,该请求由HTTP启动
proxy_set_header Connection "Upgrade";
}
}

代理 TCP和UDP

stream {
upstream pptcp {
server 10.10.10.10:9994;
server 10.10.10.11:9994;
}
server {
listen 9994;
proxy_pass pptcp;
proxy_connect_timeout 10s;
proxy_timeout 3h;
}
upstream ppudp {
server 10.10.10.10:9995;
server 10.10.10.11:9995;
}
server {
listen 9995 udp;
proxy_pass ppudp;
proxy_connect_timeout 10s;
proxy_timeout 3h;
}
}

nginx反向代理 报错:Error during WebSocket handshake: Unexpected response code: 403的更多相关文章

  1. easyswoole报错:failed: Error during WebSocket handshake: Unexpected response code: 200

    WebSocket connection to 'ws://www.xxxx.com/xxx/xx' failed: Error during WebSocket handshake: Unexpec ...

  2. WebSocket connection to,Error during WebSocket handshake: Unexpected response code: 404

    使用标准的JSR 356注解时,需要使用tomcat 8.x版本,如果使用tomcat 7.x的版本,则需要继承WebSocketServlet,否则会报WebSocket connection to ...

  3. struts2+websocket报错:failed: Error during WebSocket handshake: Unexpected response code:404

    最近把websocket集成进项目里面来,打开网页总是会遇到这样的错误. 网上说的原因有3种,但是都不适合我,但是也记录下. 1.struts2截拦掉了ws的请求.这种援用可以尝试把web.xml清空 ...

  4. Spring 整合WebSocket, Error during WebSocket handshake: Unexpected response code: 302 还有200的错误

    springboot 集成websocket 及其简单,,,但是管理端使用的是Spring,原生配置,发生这个错误,,,302 被重定向了...我起的是本地locallhost,把ip换成 local ...

  5. WebSocket handshake: Unexpected response code: 404

    在执行    http://www.cnblogs.com/best/p/5695570.html  提供的 websocket时候, 报错了 “WebSocket handshake: Unexpe ...

  6. nginx反向代理https访问502, nginx反向代理, 支持SNI的https回源,SNI源点,nginx反向代理报错

    正常nginx配置了SSL是可以通过HTTPS访问后端的,但是对有配置SNI + https后端的支持有点麻烦. 编译安装nginx后,看一下是否支持SNI /usr/local/nginx/sbin ...

  7. nginx 反向代理报400错误与Host关系

    转载自:https://blog.csdn.net/qq_22208737/article/details/80787396 如果后端真是的服务器设置有类似防盗链或者根据http请求头中的host字段 ...

  8. Nginx 反向代理报400错误解决方法!

    如果后端真是的服务器设置有类似防盗链或者根据http请求头中的host字段来进行路由或判断功能的话,如果反向代理层的nginx不重写请求头中的host字段,将会导致请求失败,报400错误,解决办法: ...

  9. iOS开发——打包报错error: linker command failed with exit code 1

    真机运行没问题,打包报错: clang: error: linker command failed with exit code 1 (use -v to see invocation) 原因:在Xc ...

随机推荐

  1. 20191213-RF中报告打不开提示Opening Robot Framework report failed

    配置好Jenkins的RF框架后跑了一次autotest发现哦豁report打不开,网上找了一堆方法都是只能临时解决,重启后又失效了.现在给出临时解决方案和永久解决方案 首先错误信息如下:  临时解决 ...

  2. dubbo中使用动态代理

    dubbo的动态代理也是只能代理接口 源码入口在JavassistProxyFactory中 public class JavassistProxyFactory extends AbstractPr ...

  3. Mybatis @ResultMap复用@Result

    @ResultMap复用@Result: 可以简写成:@ResultMap("userMap")

  4. node-red 流程的导入导出

    流程的导入导出 流程的导出 选中所要导出的流程,点击右上角三条杠按钮 有两个选项,导出到剪贴板和库 1. 导出到剪贴板 导出到剪贴板可以复制,粘贴到任何地方 [{,,,,,,"wires&q ...

  5. PDA日常问题

    一.连接网络异常 1.摩托摩拉3190连接wifi时报错,提示:scan error adapter unavailable 确认网卡是不是禁用状态,CE是右下角有个蓝色的图,上面有个X,点一下,然后 ...

  6. django AJAX 的应用

    目录 AJAX 的使用 AJAX简介 AJAX常见应用情景 AJAX的优缺点 jQuery实现的AJAX JS实现AJAX AJAX请求如何设置csrf_token Form表单上传文件 AJAX上传 ...

  7. iOS pushViewController 和 presentViewController的区别 详解

    pushViewController 导航控制器入栈的方式切换页面presentViewController 模态切换的方式切换页面 1:用 UINavigationController 的时候用 p ...

  8. pillow安装出错的解决办法

    apt-get install python3-dev python3-setuptools libtiff5-dev zlib1g-dev libfreetype6-dev liblcms2-dev ...

  9. SAP云平台上的SSO Principal Propagation设置

    我今天试图使用SAP云平台的SAP WebIDE Fullstack时,发现打不开, 遇到如下错误信息: You are not authorized to work with SAP Web IDE ...

  10. JSP中Get提交方式的中文乱码解决

    最近对JSP&Servlert的原理很感兴趣,所以今天花时间看了一下:无奈在一个编码问题上困扰很久 这是我的解决思路: (1)检查网页(html/jsp)页面的编码: (2)检查服务器端的处理 ...