Rails 3.1, Unicorn and Apache: static files

后端 未结 2 1340
礼貌的吻别
礼貌的吻别 2021-02-09 00:44

I have Rails 3.1, Unicorn and Apache setup. My Apache settings are below and production.rb looks like this. I like using h264 streaming but since Rails is serving these video fi

2条回答
  •  不思量自难忘°
    2021-02-09 01:22

    I have a post for this problem (yeah it also happened to me), hope it will help.

    The key point is to remove ProxyPass / balancer://unicornservers/ pattern, because it would override your Rewrite Rule

    Here is my apache server config.

    
    
      ServerName example.org
      DocumentRoot /dir/of/your/project
    
      RewriteEngine On
    
      # Redirect all non-static requests to unicorn
      RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
      RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]
    
      
        BalancerMember http://127.0.0.1:2007
      
    
    
    

提交回复
热议问题