aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkeith <keith>2008-06-04 18:02:55 +0000
committerkeith <keith>2008-06-04 18:02:55 +0000
commit84a2bc453880c94a964de358d037046ccf1d4011 (patch)
treee4484e941459f82dca40e1176e90713f20a674b3
parentdc62110cc0aadee98109574767459d56fe9f5657 (diff)
Rewrite rules in vhost.conf
-rw-r--r--config/vhost.conf24
1 files changed, 24 insertions, 0 deletions
diff --git a/config/vhost.conf b/config/vhost.conf
new file mode 100644
index 000000000..1317f02c0
--- /dev/null
+++ b/config/vhost.conf
@@ -0,0 +1,24 @@
+RewriteEngine On
+RewriteLog /var/log/apache2/rewrite.log
+RewriteLogLevel 3
+
+# Make a file down.html in the DocumentRoot bring down the whole site and
+# display itself.
+RewriteCond %{DOCUMENT_ROOT}/down.html -s
+RewriteRule /(.+).cgi /down.html [R]
+RewriteCond %{DOCUMENT_ROOT}/down.html !-s
+RewriteRule /down.html / [R]
+
+# Use Mongrel as the main webserver (more reliable than FastCGI for Rails)
+RewriteCond %{REQUEST_URI} !^/jslib/
+RewriteCond %{REQUEST_URI} !^/fcgi/
+RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
+RewriteRule ^/(.*) http://localhost:3000/$1 [P]
+# This is roughly equivalent to ProxyPass, but lets Apache serve the static files.
+# ProxyPass / http://localhost:3000/
+
+# Pass through the HTTP basic authentication to mongrel
+# sigh - doesn't work in apache 1.3
+#RewriteCond %{LA-U:REMOTE_USER} (.+)
+#RewriteRule . - [E=RU:%1]
+#RequestHeader add X-Forwarded-User %{RU}e