okay, I managed to solve the problem by creating a mime.types file with ".pdf: application/pdf" and referencing it using ":mime_map config/mime.types". The problem is, this means that the pdf file is being served by mongrel, whereas it should be served as a static file via apache. In my rewrite log, I see the following:
<br><br>(3) applying pattern '^/$' to uri '/pdfs/instructions.pdf'<br>(3) applying pattern '^([^.]+)$' to uri '/pdfs/instructions.pdf'<br>(3) applying pattern '^/(.*)$' to uri '/pdfs/instructions.pdf'<br>(4) RewriteCond:<br>
(3) input='/usr/local/www/data/vhosts/www.mydomain.com/current/public/pdfs/instructions.pdf'<br>(3) pattern='!-f' => not-matched<br>(1) pass through /pdfs/instructions.pdf <br><br>and I'm using the following rewrite rules:
<br><br> # Rewrite index to check for static<br> RewriteRule ^/$ /index.html [QSA] <br><br> # Rewrite to check for Rails cached page<br> RewriteRule ^([^.]+)$ $1.html [QSA]<br><br> # Redirect all non-static requests to cluster
<br> RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f<br> RewriteRule ^/(.*)$ balancer://mls%{REQUEST_URI} [P,QSA,L]<br><br>so doesn't "pass through" mean that the file is being passed through to apache to be served statically? I have sendfile installed, so does that mean that it's using sendfile to give apache a reference to the file, and so that may be why it's having trouble with mime type (since maybe apache doesn't use it's own mime type when being passed a reference via sendfile)?
<br><br>I just want to make sure that I'm doing this the correct way and that my static files are being served statically. Am I doing the right thing by adding the mime type to the mongrel mime_map file? Thanks,<br><br>
Mike<br><br><div><span class="gmail_quote">On 7/7/06, <b class="gmail_sendername">Mike Garey</b> <<a href="mailto:random49k@gmail.com">random49k@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>I'm using the instructions from <a href="http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/
</a> to configure mongrel_cluster with apache mod_proxy_balancer. Everything works fine, except when I try to link to a pdf file to be opened in a new window, it displays the contents of the pdf as text instead of opening it as a pdf document through Acrobat. If I try adding a link to a pdf file in a regular html file (as in under ~/public_html) which is served directly by apache (and not by mongrel), it works properly.. I'm not sure exactly how to configure mongrel/apache to play nicely with pdf files.. Is this happening because I haven't told apache that pdf files are static content and should be handled by it rather than mongrel? If anyone has any suggestions on how to get this to work, please let me know. Thanks,
<br></div><div><span class="sg"><br>Mike<br>
</span></div></blockquote></div><br>