I have Rails 3.1, Unicorn and Apache. My Apache settings are lower, and production.rb looks like this . I like to use h264 streams, but since Rails serves these video files, Apache Mod will not work.
DocumentRoot /blabla/current/public RewriteEngine On Options FollowSymLinks <Proxy balancer://unicornservers> BalancerMember http://127.0.0.1:4000 </Proxy> # 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 <Proxy *> Order deny,allow Allow from all </Proxy> XSendFile On XSendFileAllowAbove on
I need to enable serve_static_assets or I cannot load any static things. I also have precompiled assets, but that won't make any difference since the file is not accessible from the public directory if Rails (Rack, I think) is not running the service.
Should I use config.action_controller.asset_host or something is wrong with my Apache configuration.
ruby-on-rails apache static-files unicorn
jiriki
source share