This problem occurs when nginx sets ssl proxy. . .
为情所困
为情所困 2017-05-16 17:15:36
0
1
375

This is what I set:

upstream for_ssl {
server 127.0.0.1:1234;
}
proxy_pass http :// for_ssl;

The following is the error:

400 Bad Request
Sec-WebSocket-Key not found.
This is a WebSocket service and can not be accessed via HTTP.

Please give me some advice. .

为情所困
为情所困

reply all(1)
左手右手慢动作

nginx has the concept of protocol upgrade when acting as a proxy for long connections
With this code, there will be no problem and protocol upgrade is allowed

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!