Possible bug with cached redirects and chunked encoding

Maxim Dounin mdounin at mdounin.ru
Wed Jan 13 21:04:28 MSK 2010


Hello!

On Wed, Jan 13, 2010 at 12:05:24PM -0500, sfussenegger wrote:

> I have a problem using nginx as reverse proxy cache (in front of Jetty). 
> 
> Depending on the client, a redirect from cache takes either very long to complete or fails (curl: (18) transfer closed with outstanding read data remaining) - only chrome works as expected. 
> 
> It looks like a redirect from cache doesn't play nicely with "Transfer-Encoding: chunked". Using Wireshark, I've seen that no empty chunk follows the header after a cache hit. I'd bet that this is illegal (and handled differently in different clients - hence the different behavior).
> 
> Is this a known issue? Or is there a patch available? As a quick workaround, I've disabled caching of redirects.

[...]

> Request to backend server:
> 
> $ curl -i http://local.example.com:8082/script/all.js
> HTTP/1.1 301 Moved Permanently
> Date: Wed, 13 Jan 2010 16:33:15 GMT
> Location: http://www.local.example.com/script/all.js
> Content-Length: 0

Looks like this problem:

http://nginx.org/pipermail/nginx/2009-December/017792.html
http://nginx.org/pipermail/nginx/2009-October/015789.html

Maxim Dounin



More information about the nginx mailing list