Menu:

Post History:

Animals Matter to Me

Serving static files without proxying

In preparation for working on the prologblog.com CSS, I wanted to change my Apache config to serve static files like CSS and JavaScript before those requests got passed to the Prolog application.

Adjusting the rewrite rules I was already using for a Rails application, I changed the Prolog Blog config to use this:

# Redirect all non-static requests to Prolog
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ http://127.0.0.1:8000%{REQUEST_URI} [P,QSA,L]


and I was then able to remove my Proxy commands I used originally:

ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/


Does anyone know any reason why having the rewrite rule do all the proxying work wouldn’t be the best way? It has been working fine, but I was surprised by the fact that now no proxy commands are required.

1 comment


Gates21PEGGY on July 16, 2010 1:36PM

There is not another easy way to have excellent mark than to compose the <a href="http://www.manyessays.com">term paper</a> related to this good topic but it is, as well, real to purchase the <a href="http://www.manyessays.com/essays/middle-east">middle east essay paper</a> from the online essay writing service.

Add Comment

*
(not shown)
*

* Code: simple_captcha.jpg
* required