webman中使用gatewayworker wss问题

xjx2580

问题描述

webman项目端口8787已经使用nginx代理,并且上了证书使用域名https。现在websocket端口为7272,该如何让wss能够连接到到呢?

nginx配置:

upstream webman {
    server 127.0.0.1:8787;
    keepalive 10000;
}

server {
  server_name xxx.xxx.cn;
  listen 80;
    listen 443 ssl http2;
  access_log off;
  root /your/webman/public;

  ssl on;
  ssl_certificate /etc/ssl/chat_server.pem;
  ssl_certificate_key /etc/ssl/chat_server.key;
  ssl_session_timeout 5m;
  ssl_session_cache shared:SSL:50m;
  ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;

  location / {
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $host;
      proxy_http_version 1.1;
      proxy_set_header Connection "";
      if (!-f $request_filename){
          proxy_pass http://webman;
      }
  }

  location /wss{
    proxy_pass http://127.0.0.1:7272;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header X-Real-IP $remote_addr;
  }
}
1158 1 1
1个回答

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