title: Rails 3.1, Unicorn and Apache: static files
body: <p>I have Rails 3.1, Unicorn and Apache setup. My Apache settings are below and production.rb looks like <a href="http://www.pastie.org/2859132" rel="noreferrer">this</a>. I like using h264 streaming but since Rails is serving these video files, the Apache Mod won't work.</p>
  
  <pre><code>DocumentRoot /blabla/current/public
  
  RewriteEngine On
  Options FollowSymLinks
  
  &lt;Proxy balancer://unicornservers&gt;
    BalancerMember http://127.0.0.1:4000
  &lt;/Proxy&gt;
  
  # Redirect all non-static requests to rails
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]
  
  ProxyPass / balancer://unicornservers/
  ProxyPassReverse / balancer://unicornservers/
  ProxyPreserveHost on
  
  &lt;Proxy *&gt;
   Order deny,allow
   Allow from all
  &lt;/Proxy&gt;
  
  XSendFile On
  XSendFileAllowAbove on
  </code></pre>
  
  <p>I have to enable serve_static_assets or I cannot download any static stuff. I have precompiled assets too but it won't make any difference as no file is available from public directory unless Rails (Rack I guess) is doing the serving.</p>
  
  <p>Should I use config.action_controller.asset_host or is there something wrong with my Apache config.</p>