tags:

views:

64

answers:

3

We have django 1.1.1 website, that works fine on development server (python manage.py runserver). But when we use nginx + wsgi, ngnix is timed out and return "504 Gateway is time out". error.log is empty.

So, probably it is environment issue but I don't know where to start because it was working fine and now its not and I have no error to point me in the right direction. Restarting nginx doesn`t help.

I'm new enough to this environment, could someone possible give me some idea of how I could find the problem

Thanks, Derek

A: 

Look at the error logs for the Nginx server. My guess is that it's invoking something through FCGI or WSGI (whatever you had set up), but that it's not responding correctly. More detail should be in those logs.

heckj
This is the problem, the error.log for for ngnix for that site is showing other small errors but nothing to do with the 504 error I'm getting.
Derek Organ
+2  A: 

You can try setting DEBUG = True in settings.py and see if you can review the errors.

If that doesn't work, set DEBUG back to False try setting up the ADMINS so you receive emails with the error reports.

Those are my only suggestions at the moment. Good luck.

Louis
I had debug set to true it still was timing out with no error.
Derek Organ
@Derek, Ahh. Yeah, I use runfcgi + nginx and there's times where I've been stuck for a good hour trying to figure out what the issue was.
Louis
A: 

It turned out to be mistake in the middleware configuration ... fixed it and all back to normal.

Derek Organ