Forum: NGINX X-Accel-Redirect can not serve some files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Vitalie L. (Guest)
on 2009-01-12 12:57
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:
http://www.assembla.com/spaces/breakout/documents/...

this link does not work:
_http://www.assembla.com/spaces/tracks-tickets/docu...

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

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/docu...


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/docu...

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.
Igor S. (Guest)
on 2009-01-12 13:26
(Received via mailing list)
On Mon, Jan 12, 2009 at 11:57:36AM +0100, Vitalie Lazu wrote:

>
> Document page:
> http://www.assembla.com/spaces/tracks-tickets/docu...
>
> In rails log I see 2 requests for the file download, but I made only
> one.

What is in nginx error log ?
Vitalie L. (Guest)
on 2009-01-12 13:29
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.
Vitalie L. (Guest)
on 2009-01-12 13:30
> What is in nginx error log ?

Ticket with details:
http://www.assembla.com/spaces/breakout/tickets/32...

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;
http://help.yahoo.com/help/us/ysearch/slurp)"
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;
http://help.yahoo.com/help/us/ysearch/slurp)"
This topic is locked and can not be replied to.