# Streaming request

**URL:** <https://www.ruby-forum.com/t/streaming-request/234956>\
**Category:** NGINX\
**Created:** [May 21, 2013, 2:28pm UTC](https://www.ruby-forum.com/t/streaming-request/234956 "2013-05-21T14:28:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [May 21, 2013, 2:28pm UTC](https://www.ruby-forum.com/t/streaming-request/234956/1 "2013-05-21T14:28:44Z")

</div>

Hi,

I’m trying to do a streaming request that uses chunked encoding that  
gets  
forwarded to a back-end node.js http server. In this case the client  
does  
not end the request before it gets a response header from the server.  
This works well if using node.js standalone, but when fronted by Nginx,  
nginx does not forward the request to my node process and a minute later  
returns a 408 to the client.

I’m using nginx 1.5.0 with the following configuration:

upstream myservername {  
server 127.0.0.1:8888;  
}

server {  
listen 80;  
listen 443 ssl;

server\_name myservername;

ssl\_certificate …  
ssl\_certificate\_key …

location / {  
proxy\_buffering off;  
proxy\_http\_version 1.1;

```
proxy_pass http://myservername;

```

}  
}

Any clues on how to solve this?

TIA!

–  
Pedro

Posted at Nginx Forum:

> **[streaming request](https://forum.nginx.org/read.php?2,239384,239384#msg-239384)**
>
> Hi, I'm trying to do a streaming request that uses chunked encoding that gets forwarded to a back-end node.js http server. In this case the client does not end the request before it gets a response header from the server. This works well if using...

---

<div class="post-metadata">

**Author:** ![pgte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e36b37/32.png) [@pgte](https://www.ruby-forum.com/u/pgte)\
**Post date:** [May 21, 2013, 3:34pm UTC](https://www.ruby-forum.com/t/streaming-request/234956/2 "2013-05-21T15:34:12Z")

</div>

Hello!

On Tue, May 21, 2013 at 08:28:19AM -0400, pgte wrote:

> Hi,
> 
> I’m trying to do a streaming request that uses chunked encoding that gets  
> forwarded to a back-end node.js http server. In this case the client does  
> not end the request before it gets a response header from the server.  
> This works well if using node.js standalone, but when fronted by Nginx,  
> nginx does not forward the request to my node process and a minute later  
> returns a 408 to the client.

This doesn’t work as nginx insists on reading a request body  
before the request is passed to a backend server.

You may consider switching a protocol to something like WebSocket.  
See here for instructions how to proxy WebSocket connections  
though nginx:

> **[WebSocket proxying](http://nginx.org/en/docs/http/websocket.html)**

–  
Maxim D.

> **[nginx: donation](http://nginx.org/en/donation.html)**

---

<div class="post-metadata">

**Author:** ![pgte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e36b37/32.png) [@pgte](https://www.ruby-forum.com/u/pgte)\
**Post date:** [May 23, 2013, 8:14pm UTC](https://www.ruby-forum.com/t/streaming-request/234956/3 "2013-05-23T20:14:08Z")

</div>

On Tue, May 21, 2013 at 05:33:29PM +0400, Maxim D. wrote:

> > nginx does not forward the request to my node process and a minute later  
> > returns a 408 to the client.
> 
> This doesn’t work as nginx insists on reading a request body  
> before the request is passed to a backend server.

People are asking for “no buffer” feature very often,  
it’s clearly something nginx is missing and should have.

I know Weibin has been working on a patch to do exactly that  
(“no\_buffer” patch).  
Currently it’s available and stable for nginx 1.2.x,  
but the 1.4 version is still work-in-progress.

– Pasi
