I am trying to deploy a Flask Python app on dotcloud (which uses nginx) and MongoDB, and at one point am routing to Twitter for OAuth authorization. Upon trying to route back to my app I get the nginx error described in the title, and have no idea why. Any suggestions? It works perfectly fine in development mode with localhost
Take a look at your uWSGI logs which for me were in /var/log/uwsgi
.
I encountered this problem when not having a plugin installed. In my case # apt-get install uwsgi-plugin-python
did the trick, because I was trying to execute a python script.
Not having this plugin yielded a 502
from nginx, and in my uWSGI logs I saw:
-- unavailable modifier requested: 0 --
That error usually happens when your upstream server timeouts out (takes too long) Are you seeing anything in your application logs (/var/log/supervisor/
) when this happens? Also how long are the requests taking.
I have seen a problem where the uWSGI server is connecting to an external source and the external source is taking a long time to respond, which causes the uWSGI request to take a long time, and thus nginx gives up.
Another thing to look for is to see if your process is running out of memory and is getting killed, which could also cause this sort of error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With