nginx使用wss协议出现wss handshake: Unexpected response code: 400
2017-02-27 17:14
591 查看
在nginx中配置好https协议之后,我以为可以使用反向代理在tomcat容器中的页面js调用websocket用wss了,但是没想到居然报了个错:
查了一下官网才发现原来在配置反向代理的时候,如果需要使用wss,还需要加上如下配置:
官网链接:https://www.nginx.com/blog/websocket-nginx/
handshake: Unexpected response code: 400
查了一下官网才发现原来在配置反向代理的时候,如果需要使用wss,还需要加上如下配置:
location /wsapp/ { proxy_pass http://wsbackend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
官网链接:https://www.nginx.com/blog/websocket-nginx/
相关文章推荐
- J2ee中使用Struts2+WebSocket时console窗口出现“Unexpected response code:404”的原因
- WebSocket connection to,Error during WebSocket handshake: Unexpected response code: 404
- 使用nginx解决一台服务器中ws协议与wss协议共存问题 2017-07-09 13:29:06
- android Volley: [461] BasicNetwork.performRequest: Unexpected response code 400 for xxxxx
- WebSocket connection to,Error during WebSocket handshake: Unexpected response code: 404
- WebSocket handshake: Unexpected response code: 404
- failed: Error during WebSocket handshake: Unexpected response code: 200
- failed: Error during WebSocket handshake: Unexpected response code: 200
- WCF 中,出现The remote server returned an unexpected response: (400) Bad Request.
- Error during WebSocket handshake: Unexpected response code: 200错误
- nginx升级到 0.8.53 之后,使用老的配置出现duplicate MIME type "text/html"问题的解决办法
- WebSocket Unexpected response code: 500
- 在同一个jsp页面上即使用字符流,又使用字节流就会出现以下异常:getOutputStream() has already been called for this response
- ActiveMQ使用STOMP协议的一个错误问题:Unexpected ACK received for message-id
- Websockets with Glassfish 3.1.2 and Grizzly - Unexpected response code: 405
- 在使用EFCodeFirst中出现类型“System.Data.Objects.ObjectContext”在未被引用的程序集中定义的解决方案
- 如果使用 Response.End、Response.Redirect 或 Server.Transfer 方法,将出现 ThreadAbortException 异常
- 求助:nginx反向代理后,使用Response.Redirect()页面长时间无响应
- linux上wget命令出现HTTP request sent, awaiting response... 400 Bad Request问题
- 使用Parse内付费服务出现的Error Domain=Parse Code=146 "The operation couldn’t be completed. (Parse error 146.)