Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up a HTTP streaming server I wrote with Tornado and python. Basically, it keeps the connection alive and occasionally flushes information out. It's a bit like long polling, except the connection isn't broken by the server.

Is it possible to put something like this behind nginx? I'm testing it from my browser, and I can't see any output until the server breaks the connection, then it's all sent at once.

share|improve this question
up vote 4 down vote accepted

You need to turn proxy_buffering off for the streaming requests. If all requests to the backend will be streaming, you can just use . As it states in that wiki entry, you can also manage buffering on a per-request basis by having your backend include an X-Accel-Buffering header to turn buffering on or off.

share|improve this answer
This was it. Thank you! – Paul Apr 26 '11 at 4:02

Just a guess. Is the tcp_nodelay to Off? It is on by default unless turned off. Nginx Documentation

share|improve this answer
Hm, that didn't do it. I should also mention that the Tornado app acts as expected when I access it directly, so I'm guessing nginx is doing some kind of buffering? – Paul Apr 25 '11 at 3:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.