当前位置:网站首页>websocket Handshake failed due to invalid Upgrade header
websocket Handshake failed due to invalid Upgrade header
2022-08-03 17:12:00 【悟能的师兄】
解决办法:在 Nginx ,location 中添加以下代码:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
完整的nginx配置信息如下:
server {
listen 80;
server_name localhost;
#my java server config
location /website/ {
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://127.0.0.1:8848/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# enables WS support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
边栏推荐
- [Unity Getting Started Plan] Basic Concepts (6) - Sprite Renderer Sprite Renderer
- isNotBlank与isNotEmpty
- 【技术白皮书】第一章:OCR智能文字识别新发展——深度学习的文本信息抽取
- 从MatePad Pro进化看鸿蒙OS的生态势能
- Understand the recommendation system in one article: Outline 02: The link of the recommendation system, from recalling rough sorting, to fine sorting, to rearranging, and finally showing the recommend
- “68道 Redis+168道 MySQL”精品面试题(带解析),你背废了吗?
- 一键进入华为云会议,长期免费值得所有开发团队有一套【华为云至简致远】
- J9数字虚拟论:元宇宙的潜力:一股推动社会进步的力量
- 通俗理解apt-get 和pip的区别是什么
- Big guys.Use flink-cdc-sqlserver version 2.2.0 to read sqlserver2008R
猜你喜欢
Interviews are no longer hanged!This is the correct way to open the seven schemes of Redis distributed locks
高效的组织信息共享知识库是一种宝贵的资源
学会 Arthas,让你 3 年经验掌握 5 年功力!
The strongest distributed lock tool: Redisson
面试突击71:GET 和 POST 有什么区别?
CAD如何自定义快捷键
C# 构造函数如人之影子
[Unity Getting Started Plan] Basic Concepts (7) - Input Manager & Input Class
A complete detailed tutorial on building intranet penetration ngrok (with pictures and truth)
华为ECS云服务器上安装Docker及部署Redis详细教程【华为云至简致远】
随机推荐
数据中台“集存通用治”功能场景说明
面试突击:什么是粘包和半包?怎么解决?
B站回应HR称核心用户是Loser;微博回应宕机原因;Go 1.19 正式发布|极客头条
TiKV & TiFlash accelerate complex business queries丨TiFlash application practice
怎么在opengauss中进行测试自己添加的新函数的性能(循环n次的运行时间)?
【保姆级示例向】观察者模式
一个域名对应多个IP地址
为何微博又双叒叕崩溃了?
204. Count Primes
【云驻共创】【HCSD大咖直播】亲授大厂面试秘诀
软件测试<用例篇>
“68道 Redis+168道 MySQL”精品面试题(带解析),你背废了吗?
node连接mongoose数据库流程
并发高的情况下,试试用ThreadLocalRandom来生成随机数
JS 字符串转 GBK 编码超精简实现
如何直击固定资产管理的难题?
LeetCode·1163.按字典序排在最后的子串·最小表示法
关于oracle表空间在线碎片整理
IP属地如何高效率识别
Selective Search学习笔记