美文网首页
nginx反向代理 websocket

nginx反向代理 websocket

作者: 东京的雨不会淋湿首尔 | 来源:发表于2020-04-04 16:25 被阅读0次

nginx 反向代理 websocket

upstream homeland{ 
  # The keepalive parameter sets the maximum number of idle keepalive connections
  # to upstream servers that are preserved in the cache of each worker process. When
  # this number is exceeded, the least recently used connections are closed.
  #    keepalive 100;
      ip_hash; 
      server 123.207.64.210:8003; 

}

location  /cable {
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $host;

      proxy_pass http://homeland;

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

相关文章

网友评论

      本文标题:nginx反向代理 websocket

      本文链接:https://www.haomeiwen.com/subject/jvpjphtx.html