search

Home  >  Q&A  >  body text

node.js - 前端websocket连接提示502 Bad GateWay

在前端用websocket连接时提示说502 Bad GateWay,过了一会又自己连上了,这样体验很差啊。。。请问是什么原因呢?另外,前台关闭页面时,后台服务器没有即使获取disconnect事件。。。以上两个问题在本地测试时完全没问题。。后台用的是nodejs,(socket模块:socket.io)求教是怎么回事?!和解决办法~~

伊谢尔伦伊谢尔伦2788 days ago675

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 11:13:30

    Search nginx websocket or nginx socket.io yourself

    Don’t step on it

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 11:13:30

    It should be a background program error...
    I encountered a problem before. The background fetched data from the database. Because some fields had HTML and entities, and some did not, it caused a network request to the server 502. Later, I was able to basically conclude that 502 was a program problem...

    reply
    0
  • Cancelreply