views:

54

answers:

2

Hi folks,

I'm serving Django with mod_wsgi and Apache... unfortunately requests are returning 502 Bad Gateway error messages...

Received a invalid response

HttpResponse('OK') is affected by this

render_to_response('...') is not!


any ideas?!?

+1  A: 

realy strange...

Because the render_to_response is implemented with HttpResponse. Maybe there is a problem with your string inside HttpResponse().

  • Unicode Error?
  • Wrong Mimetype?
  • problem around your posted code..
maersu
@maersu: thanks for the response!! under the test server it works fine! :|
RadiantHex
+1  A: 

Are you using a proxy front end such as nginx? The mod_wsgi module doesn't generate such an error. The only scenario where can think this might occur, given that cant see why Django would generate a 502, is that you are using mod_wsgi embedded mode with nginx front end proxy, and the Apache server child process is crashing.

Where are you seeing this error message, in the browser or in the web server log files? Have you looked closely at Apache error log files for any other messages? Specifically look for segmentation fault message in main Apache error log (not virtual host error log).

Graham Dumpleton
@Graham: I have nginx installed but I am not using it. Is there a chance that apache and nginx were automatically configured?
RadiantHex
I wouldn't know as don't know anything about your system. Answer my questions about where you are seeing the error and what errors are in the log files. Cant help if left to guess.
Graham Dumpleton