首页  >  问答  >  正文

nginx设置ssl代理出这问题。。。

这是我设置内容:

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

下面是出的错:

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

求高人指点。。

为情所困为情所困2713 天前358

全部回复(1)我来回复

  • ringa_lee

    ringa_lee2017-05-16 17:17:36

    nginx对长连接做代理的时候有个协议升级的概念
    加上这段代码就没问题了,允许协议升级

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

    回复
    0
  • 取消回复