Last updated 25 May 2016
Table of Contents
Rack::Sendfile is typically used to serve static files directly from the webserver instead of through your Ruby application.
Heroku does not support the use of Rack::Sendfile. Rack:Sendfile usually requires that there is a front-end webserver like nginx or apache is running on the same machine as the application server. This is not how Heroku is architected. Using the Rack::Sendfile middleware will cause your file downloads to fail since it will send a body with
Content-Length of 0.
By default Rails will set this to
nil, but make sure that
config.action_dispatch.x_sendfile_header is not set in