Category Archives: Nginx File Transfers

Nginx can handle file uploads by caching the files to disk and telling Ruby on Rails where they are, rather than passing them through in the request data. Conversely, through the use of the x-accel-redirect header, Rails applications can tell Nginx to send files to users, even private ones outside of the public folder. As Ngnix is simply faster at doing these tasks compared to a slow executing Rails application lets use the right tool for the job.

Using Nginx to send files with x-accel-redirect

So far I’ve configured Nginx to handle file uploads by caching the file to disk and telling rails where it is, rather than passing it through in the request, not fun with large files.  Now to do the reverse.  Instead of Rails sending files to users thru Nginx, Rails can tell Nginx what file to [...]

Posted in Nginx File Transfers | Tagged , , , , , | Leave a comment
  •  

  • About Nahum Wild

    I'm a High Performance Website Consultant specialising in Ruby on Rails deployments. In this blog I cover common problems I've seen and provide insight on optimisation techniques.

  • Recommend Me

    Follow me on Twitter