k8s web-msg-sender

huwenliang

请问k8s部署web-msg-sender,仅支持暴露一个端口,该怎么去配置一下呢?

1952 1 0
1个回答

xiuwang

弄个nginx代理,

server {
  // ......省略其它配置.....

  location /socket.io
  {
    proxy_pass http://127.0.0.1:2120;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header X-Real-IP $remote_addr;
  }

  location / {
      proxy_pass http://127.0.0.1:2121;
  } 
}

也就是/socket.io路径的走2120端口,其它走2121

年代过于久远,无法发表回答
×
🔝