nginx反向代理 报错:Error during WebSocket handshake: Unexpected response code: 403
遇到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的更多相关文章
- 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 ...
- WebSocket connection to,Error during WebSocket handshake: Unexpected response code: 404
使用标准的JSR 356注解时,需要使用tomcat 8.x版本,如果使用tomcat 7.x的版本,则需要继承WebSocketServlet,否则会报WebSocket connection to ...
- struts2+websocket报错:failed: Error during WebSocket handshake: Unexpected response code:404
最近把websocket集成进项目里面来,打开网页总是会遇到这样的错误. 网上说的原因有3种,但是都不适合我,但是也记录下. 1.struts2截拦掉了ws的请求.这种援用可以尝试把web.xml清空 ...
- Spring 整合WebSocket, Error during WebSocket handshake: Unexpected response code: 302 还有200的错误
springboot 集成websocket 及其简单,,,但是管理端使用的是Spring,原生配置,发生这个错误,,,302 被重定向了...我起的是本地locallhost,把ip换成 local ...
- WebSocket handshake: Unexpected response code: 404
在执行 http://www.cnblogs.com/best/p/5695570.html 提供的 websocket时候, 报错了 “WebSocket handshake: Unexpe ...
- nginx反向代理https访问502, nginx反向代理, 支持SNI的https回源,SNI源点,nginx反向代理报错
正常nginx配置了SSL是可以通过HTTPS访问后端的,但是对有配置SNI + https后端的支持有点麻烦. 编译安装nginx后,看一下是否支持SNI /usr/local/nginx/sbin ...
- nginx 反向代理报400错误与Host关系
转载自:https://blog.csdn.net/qq_22208737/article/details/80787396 如果后端真是的服务器设置有类似防盗链或者根据http请求头中的host字段 ...
- Nginx 反向代理报400错误解决方法!
如果后端真是的服务器设置有类似防盗链或者根据http请求头中的host字段来进行路由或判断功能的话,如果反向代理层的nginx不重写请求头中的host字段,将会导致请求失败,报400错误,解决办法: ...
- iOS开发——打包报错error: linker command failed with exit code 1
真机运行没问题,打包报错: clang: error: linker command failed with exit code 1 (use -v to see invocation) 原因:在Xc ...
随机推荐
- go条件变量的使用和原理
场景 最近写代码时碰到一个场景, 需要使用 map[int]struct{} 结构来存储task, map的key是task的id,随时可以增减.因为的确除了看书,基本上没使用过条件变量所以后面过了一 ...
- 当base-package="controller.*"时,可见packageSearchPath为"classpath*:controller/*/**/*.class": 当base-package="controller.**"时,可见packageSearchPath为"classpath*:controller/**/**/*.class":
今天在配置Spring的component-scan时,发现了一个有趣的问题.就是在指定base-package时,如果使用了星号通配符*,有时会出现类扫描不到的情况.下面研究一下这个问题. 先介绍一 ...
- diverta 2019 Programming Contest 2
A:签到. #include<bits/stdc++.h> using namespace std; #define ll long long #define inf 1000000010 ...
- Sql Server 根据条件查找多条数据中最大值的详细记录
--(正常效果) select l.* from loadCurveSampling l left join Meter m on l.meter_id=m.Meter_ID --聚合当天最大值数据记 ...
- (六) Docker 部署 Redis 高可用集群 (sentinel 哨兵模式)
参考并感谢 官方文档 https://hub.docker.com/_/redis GitHub https://github.com/antirez/redis happyJared https:/ ...
- 微信web开发问题记录
问题一.微信浏览器中无法使用reload重载文档[VUE框架] 问题分析: 微信不支持location.reload()方法,在微信浏览器中会失效 Vue中的路由跳转是类似于ajax局部刷新,因此使用 ...
- Node学习之(第二章:http模块)
前言 继续上一节的探讨,今天我们来聊聊Node中怎么搭建一个简单的web服务器.平时大家在撸码的过程中,经常需要向服务器发送请求,然后服务器接受请求,响应数据.今天我们就来自己手写一个简单服务器,根据 ...
- day33-python之多线程
1.多线程实例 # import threading # import time # # import threading import time class MyThread(threading.T ...
- 字符串导出xml文件并弹出下载对话框
转自:https://blog.csdn.net/zhandingfeng/article/details/53887354 导出单个xml文件:[java] view plain copy ...
- js 字节操作
获取byte的高4位bit和低4位bit function getHeight4(ata){//获取高四位 int height; height = ((data & 0xf0) >&g ...