遇到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. 题解 P3957 【跳房子】

    对于这题有一个不用单调队列并且不是玄学设置区间最大值的做法 这题校内模拟考的时候打二分+枚举,结果写炸了,跑过来看题解发现为什么他们的区间最大值都是 $ 1005 $ ???特别懵,其实我的代码在dp ...

  2. nginx配置比较杂乱的总结

    常用变量 demo uri www.example.com/mock/interface?param1=203&param2=test $args uri中的参数值 ?后面的部分 param1 ...

  3. Mybatis @Result注解的使用案例

    @Result注解的使用

  4. Ubuntu 18.04 Server 配置静态ip

    刚在虚拟机里面状态了一个 Ubunut 18.04 Server 作为我的服务器,我习惯使用静态ip首先再virtualbox中设置虚拟机网络的连接方式为桥接模式进入ubuntu虚拟机根据我的印象直接 ...

  5. Linux环境下安装SVN

    最近在研究svn的代码如何迁移到GitLab,因此借助本文,重新来回顾温习下svn的安装使用. 一.SVN的安装 svn的安装很简单,在互联网的环境,直接执行以下命令行即可. yum install ...

  6. spring boot 使用GraphQL

    在此之前需要简单了解GraphQL的基本知识,可通过以下来源进行学习 GraphQL官方中文网站 :https://graphql.cn GraphQL-java 官网:https://www.gra ...

  7. jmeter中assertion的使用

    用于检查测试中得到的响应数据等是否符合预期,用以保证性能测试过程中的数据交互与预期一致. 最新版本的3.0jmeter中有13种不同的断言: 1)BeanShell断言:针对sampler中的Bean ...

  8. JavaScript前端图片压缩

    实现思路 获取input的file 使用fileReader() 将图片转为base64 使用canvas读取base64 并降低分辨率 把canvas数据转成blob对象 把blob对象转file对 ...

  9. ANE打包工具使用视频教程 -- 梦宇技术 @极客学院

    来源:http://xtiqin.blog.163.com/blog/static/17017217920133584934827/ ANE打包工具使用视频教程 2013-04-05 08:49:34 ...

  10. Duplicate zip entry [com/umeng/analytics/a.class==analytics-5.5.3.jar:com/umeng/analytics/AnalyticsConfig.class

    项目中需要用到Umeng统计分析,按照官网上的步骤做混淆后,在签名时报下面的错误: Error:java.io.IOException:Can't read [/.gradle/caches/modu ...