polling-xhr.js:157 Error 502 Bad Gateway While trying to establish connection between the client and the server using SocketIO #1804
Replies: 3 comments 3 replies
-
502 errors come from nginx. The error means that nginx is unable to forward requests your application. Either your hostname and/or port are wrong, or the server isn't listening for requests for some reason. |
Beta Was this translation helpful? Give feedback.
-
Your Falsk server apparentely resides on http://127.0.0.1:8000; but for some reason you proxy your ws connections to http://127.0.0.1:5000/socket.io. They should be same location. |
Beta Was this translation helpful? Give feedback.
-
Hi, TraubT |
Beta Was this translation helpful? Give feedback.
-
I'm trying to deploy a simple flask application where client and server can communicate with each other using SocketIO. Below code is working fine without any errors locally, but it's throwing errors while deploying. These are the only files I'm using,
app.py
home.html
I'm trying to deploy this on AWS ec2, I've used nginx web server and gunicorn3 as wsgi. I've followed this tutorial to deploy this application.
Versions
nginx configuration file
I've tried many solutions provided on stackoverflow and github related to this but couldn't make it work. I'm new to deployment, I don't know what exactly causing the below error I've tried cors, downgrading things but couldn't find a solution. Any help to make it work would be much appreciated.
Error
_
_
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions