X-Accel-Redirect can not serve some files

We use at Assembla common rails stack: nginx(0.6.33) - haproxy(1.3.15.7)

  • thin(1.0.0) and X-Accel-Redirect feature.

Some files can not be served by nginx and it returns 502 error:

This link work:

this link does not work:
_http://www.assembla.com/spaces/tracks-tickets/documents/dlC2Cc0S0r3y8Pab7jnrAJ/download?filename=lmelia_dragdrop.patch

Document page:
http://www.assembla.com/spaces/tracks-tickets/documents/dlC2Cc0S0r3y8Pab7jnrAJ

In rails log I see 2 requests for the file download, but I made only
one.


Processing DocumentsController#download (for 87.255.x.x at 2009-01-12
10:49:23) [GET]
Session ID: 57941cd34b879a650b036574575ca1b4
Parameters: {“action”=>“download”, “id”=>“dlC2Cc0S0r3y8Pab7jnrAJ”,
“filename”=>“lmelia_dragdrop.patch”, “controller”=>“spaces/documents”,
“space_id”=>“tracks-tickets”}
Cookie set: annonymous_id=cSEu3-4jyr3AeXab7jnrAJ; path=/; expires=Sun,
12 Jan 2014 10:49:23 GMT
Streaming file with nginx:
/opt/beta/filestore/alWI9M0eWr3zoYab7jnrAJ/dlC2Cc0S0r3y8Pab7jnrAJ_1
nginx path: /private/alWI9M0eWr3zoYab7jnrAJ/dlC2Cc0S0r3y8Pab7jnrAJ_1
Completed in 0.00820 (121 reqs/sec) | Rendering: 0.00006 (0%) | DB:
0.00000 (0%) | 200 OK
[http://www.assembla.com/spaces/tracks-tickets/documents/dlC2Cc0S0r3y8Pab7jnrAJ/download?filename=lmelia_dragdrop.pat

Processing DocumentsController#download (for 87.255.x.x at 2009-01-12
10:49:23) [GET]
Session ID: 391c6d6f4d16cd771e5f05fac01d17b0
Parameters: {“action”=>“download”, “id”=>“dlC2Cc0S0r3y8Pab7jnrAJ”,
“filename”=>“lmelia_dragdrop.patch”, “controller”=>“spaces/documents”,
“space_id”=>“tracks-tickets”}
Cookie set: annonymous_id=cSFBta4jyr3yxEab7jnrAJ; path=/; expires=Sun,
12 Jan 2014 10:49:23 GMT
Streaming file with nginx:
/opt/beta/filestore/alWI9M0eWr3zoYab7jnrAJ/dlC2Cc0S0r3y8Pab7jnrAJ_1
nginx path: /private/alWI9M0eWr3zoYab7jnrAJ/dlC2Cc0S0r3y8Pab7jnrAJ_1
Completed in 0.00709 (141 reqs/sec) | Rendering: 0.00006 (0%) | DB:
0.00000 (0%) | 200 OK
[http://www.assembla.com/spaces/tracks-tickets/documents/dlC2Cc0S0r3y8Pab7jnrAJ/download?filename=lmelia_dragdrop.pat

nginx(Freebsd) access files on nfs filesystem shared by Debian nfs
server.

I will appreciate if somebody will help me to debug this problem.

Thank you.

I found the problem, I think it was related haproxy.

Rails passed empty value for content-type and haproxy tried another
backend in the cluster, but why … bad headers value should make it
consider backend is dead? …

We can leave this thread for other people that will have the same
problem.

Have a nice day and sorry for inconvenience.

On Mon, Jan 12, 2009 at 11:57:36AM +0100, Vitalie Lazu wrote:

Document page:
File lmelia_dragdrop.patch | Tracks Project | Assembla

In rails log I see 2 requests for the file download, but I made only
one.

What is in nginx error log ?

What is in nginx error log ?

Ticket with details:
http://www.assembla.com/spaces/breakout/tickets/3224-Fix-502-errors-for-file-download

502 74.6.18.228 - - [05/Jan/2009:16:08:18 +0000] “GET
/spaces/tracks-tickets/documents/dlC2Cc0S0r3y8Pab7jnrAJ/download?filename=lmelia_dragdrop.patch
HTTP/1.0” 502 173 “-” “Mozilla/5.0 (compatible; Yahoo! Slurp;
Why is Slurp crawling my page? | Search for Desktop Help - SLN22600)”
502 74.6.18.228 - - [05/Jan/2009:16:09:08 +0000] “GET
/spaces/tracks-tickets/documents/dlC2Cc0S0r3y8Pab7jnrAJ/download?filename=lmelia_dragdrop.patch
HTTP/1.0” 502 173 “-” “Mozilla/5.0 (compatible; Yahoo! Slurp;
Why is Slurp crawling my page? | Search for Desktop Help - SLN22600)”