首頁  >  問答  >  主體

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 天前354

全部回覆(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
  • 取消回覆