XSendfile: critical for Rails 3.1 on Apache
After several hours troubleshooting my production Rails environment, I finally found out why images were not being served properly after an upgrade to 3.1: no XSendfile module. Rails 3.1/Sprockets apparently relies heavily on Apache’s XSendfile to serve assets, and without the module installed and configured, images will silently fail and browsers will display a missing image.
To enable under Ubuntu:
- sudo apt-get install libapache2-mod-xsendfile
- Add XSendFile On to your Apache vhost file
- Add XSendFileAllowAbove on under the directory definition for your public folder
More details here.