Right now I am using Apache in front of Rails to serve static files. If the file is not found, I want it to pass the request on to Rails.
I found before that when I had proxy pass uncommented, it proxied all the files whether they were found or not. I found this way of making it work by proxying it through the rewrite rule, but I'm wondering if this is efficient enough. Some of the documentation seemed to suggest that using ProxyPass is more configurable/optimizable/performant.
Is there a way I can/should rewrite this to use ProxyPass? Thank you very much.
# Redirect all non-static requests to thin
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ http://rails:3000%{REQUEST_URI} [P,QSA,L]
#ProxyPass / http://rails:3000/
ProxyPassReverse / http://rails:3000/
ProxyPreserveHost on