Since I posted the message below I've done a bit more investigation and discovered that the response returned when running under uWSGI uses chunked transfer encoding, whereas when I switch back to using apache/mod_wsgi it doesn't use chunked transfer encoding. I haven't changed the nginx configuration except to swap from an apache backend to uwsgi. The app code hasn't been changed in any way either.
Anyway, here's the response header when I use Nginx/Apache/mod_wsgi: Connection close Content-Encoding gzip Content-Length 135 Content-Type text/html; charset=utf-8 Date Wed, 25 Jan 2012 23:15:16 GMT Server nginx Vary Cookie,Accept-Encoding Here's the response header when I use Nginx/uWSGI: Connection close Content-Type text/html; charset=utf-8 Date Wed, 25 Jan 2012 23:18:12 GMT Server nginx Transfer-Encoding chunked Vary Cookie On Wed, Jan 25, 2012 at 12:07 PM, Guy Knights <[email protected]> wrote: > Hi, > > We have the strangest problem and I'm hoping someone on this list can > help. We have a django app running under uWSGI behind an Nginx reverse > proxy. The app is a game that can either run within the Facebook > iFrame or as a standalone app. > > We are using a maintenance mode middleware to return a 503 error and a > HTML response page to all users (except admins) if they visit the app > while it's in maintenance mode. For some reason, if I access the app > using the facebook iframe while it's in maintenance mode, I get a > blank white page - firebug reports a 503 returned, but there is > nothing in the response body. If I access the app as a standalone I > get the server maintenance message displayed. > > Where it gets weird is that if I put a line of code to print the > contents of the user's request during the execution of the maintenance > mode middleware, it displays the server maintenance message correctly! > The print command outputs the contents of the request to the uWSGI > log, it doesn't send this as part of the response or anything like > that. > > We've preivously run this app under apache/mod_wsgi using the same > nginx frontend and never had this problem before. The maintenance mode > message was always displayed correctly in both facebook and when we > accessed the app standalone when we used the apache/mod_wsgi setup. > > Does anyone have any idea what's going on here? I'm baffled. > > Thanks, > Guy -- Guy Knights Systems Administrator Eastside Games www.eastsidegamestudio.com [email protected] _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
