使用nginx代理上云API,websocket连接失败

Completed

Comments

3 comments

  • 塞翁失码

    测试使用nginx的上述配置,可以正常代理其他websocket服务。 是需要调整上云API的代码吗?

    0
    Comment actions Permalink
  • 胡权智

    应该是不用改代码的,这里面有个配置是关于websocket的连接时间的,关于心跳的还是啥的一个设置要设置大一点,可以查一下,我之前遇到这个问题,设置了就好了
        location /websocket {
            proxy_pass http://127.0.0.1:6789;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }

    0
    Comment actions Permalink
  • DJI Developer Support
    过期时间可以配置的长一点, 也可以发送心跳。
    0
    Comment actions Permalink

Please sign in to leave a comment.