为什么在nginx上部署 Flask-scoket.io+Vue-scoket.io 服务器无法正常运作?

Flask-scoket.io+Vue-scoket.io+nginx+gunicorn部署问题

一直报 400(bad request)错误

vue main.js代码

Vue.use(new VueSocketIO({
  debug: true,
  // 服务器端地址
  connection: '/a/text',

 }))

Vue.config.js代码

 '/a': {
        target: 'http://59.110.69.160:8070',
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/a': ''
        }

nginx.conf部署代码

server {
        listen       8070 default_server;
        listen       [::]:8070 default_server;  
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location /socket.io {/这里 加上 ^~ 重写的化也是400
        proxy_pass http://127.0.0.1:5010;这里尝试着用/scoket.io都没有用
        proxy_redirect off;
        proxy_buffering off;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        add_header Access-Control-Allow-Origin *;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";

    }
    }

gunicorn启动

gunicorn -k gevent -w 5 -b 127.0.0.1:5010 socket:app

https://www.cnblogs.com/ld1226/p/7365229.html