RadiantHex
RadiantHex

Reputation: 25567

Apache + Mod_wsgi returning 502 Bad Gateway!

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?!?

Upvotes: 0

Views: 1850

Answers (2)

Graham Dumpleton
Graham Dumpleton

Reputation: 58533

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).

Upvotes: 1

maersu
maersu

Reputation: 3282

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..

Upvotes: 1

Related Questions