Apache / Unicorn:如何让Apache提供静态文件

我正在按照这个教程安装Apache +独angular兽,但似乎Apache不提供任何静态文件。 这里是我想出的configuration(看看Redirect all non-static requests to unicorn特别是):

 <VirtualHost *:80> ServerName www.unstilted.com:80 ServerAlias *.unstilted.com DocumentRoot /var/www/unstilted/current/public ErrorDocument 503 /system/maintenance.html RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{REQUEST_FILENAME} !/system/maintenance.html RewriteRule ^.*$ /system/maintenance.html [L] # Rewrite to check for Rails non-html cached pages (ie xml, json, atom, etc) RewriteCond %{THE_REQUEST} ^(GET|HEAD) RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_URI} -f RewriteRule ^(.*)$ /cache/%{HTTP_HOST}$1 [QSA,L] # Rewrite to check for Rails cached html page RewriteCond %{THE_REQUEST} ^(GET|HEAD) RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_URI}.html -f RewriteRule ^(.*)$ /cache/%{HTTP_HOST}$1.html [QSA,L] # no www RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1$1 [R=301,L] <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> </VirtualHost> 

在我/var/www/unstilted/current/public目录我有robots.txt,但是当我去到mydomain.com/robots.txt ,请求去独angular兽,它不是由Apache处理。

我的configuration有什么问题? 我如何让Apache服务于静态文件?

谢谢!

在这种情况下丢失%{DOCUMENT_ROOT}%{REQUEST_FILENAME}是文件的完整文件系统(不是URL)path,所以它应该像这样匹配:

 RewriteCond %{REQUEST_FILENAME} !-f