2
我使用rails 3.0.7,我在生产环境中安装了apache2 + unicorn。服务静态文件,apache +独角兽
我有我的.conf
文件如下
<VirtualHost *:80>
ServerName something.com
# Point this to your public folder of teambox
DocumentRoot /pal/public
RewriteEngine On
<Proxy balancer://unicornservers>
BalancerMember http://127.0.0.1:5000
</Proxy>
# Redirect all non-static requests to unicorn
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>
试图RewriteCond %{REQUEST_FILENAME} !-f
但似乎Apache不服务于静态请求(在公共目录中的文件)。所有的静态请求也涉及到rails。我错过了什么配置?
我会把[Nginx](http://nginx.org)而不是Apache。处理静电要好得多。 – 2011-12-26 11:36:21
Yup意识到这一点..但商界人士.. !!!不能帮助那部分 – 2011-12-26 11:45:45
那么把nginx放在apache前面呢? :-) – 2011-12-26 11:47:21