Reduce. Reuse. Rehacktor.

x_sendfile_header -- why my Heroku app won't serve static assets

8.14.2013

Heroku used to do three magical configuration steps for Rails 3 applications that no longer work with Rails 4 apps due to the removal of support for vendor/plugins. With the rails_12factor gem for Rails 4 apps they only added two magical steps back.

The two they added back are:

  • Redirecting all logs to STDOUT
  • Setting config.serve_static_assets to true

The one they missed is setting x_sendfile_header to nil. Not every Rails app has the x_sendfile_header setting set to a non-nil value. But for those that do, their static asset serving on Heroku will not work without a config file change; even if they include the rails_12factor gem in their Gemfile.

I submitted a pull request, I guess we'll see if anything comes of it.

categories