Disable buffering for nginx.
authorDavid Schoonover <dsc@wikimedia.org>
Fri, 8 Jun 2012 22:39:13 +0000 (15:39 -0700)
committerDavid Schoonover <dsc@wikimedia.org>
Fri, 8 Jun 2012 22:39:13 +0000 (15:39 -0700)
lib/server/proxy.co

index 15349a5..8dafdf6 100644 (file)
@@ -26,6 +26,9 @@ ProxyMiddleware = (options={}) ->
         unless matchesList whitelist, target.hostname
             return res.send {error:'Domain is not whitelisted'}, 403
         
+        # Set the no-buffering flag for nginx
+        res.header 'X-Accel-Buffering', 'no'
+        
         console.log "[Proxy] #targetUrl"
         request.get targetUrl .pipe res