#
# Poor man's balancing on Apache 2.0
<Proxy *>
Allow from all
</Proxy>
ServerAlias [url]www.mysite.com[/url]
DocumentRoot /path/to/your/rails-app/public
<Directory "/path/to/your/rails-app/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Location /plesk-stat>
Options +Indexes
</Location>
ProxyRequests Off
ProxyPassReverse / [url]http://localhost:3010/[/url]
ProxyPassReverse / [url]http://localhost:3011/[/url]
ProxyPassReverse / [url]http://localhost:3012/[/url]
ProxyPassReverse / [url]http://localhost:3013/[/url]
ProxyPassReverse / [url]http://localhost:3014/[/url]
ProxyPreserveHost On
RewriteEngine On
RewriteRule ^/error/.* /usr/share/apache2/$0 [L]
RewriteRule ^/plesk-stat/?(.*) /var/www/vhosts/mysite.com/statistics/$1 [L]
RewriteRule ^/(webstat|webstat-ssl|ftpstat|anon_ftpstat)/?.*$ /var/www/vhosts/mysite.com/statistics$0 [L]
RewriteRule ^/awstats-icon/(.*) /usr/share/awstats/icon/$1 [L]
RewriteMap servers rnd:/etc/apache2/mongrel-ports-map-myapp.txt
RewriteRule ^/(images|stylesheets|javascripts|system)/?(.*) $0 [L]
RewriteRule ^/(.*)$ [url]http://localhost:[/url]${servers:ports}/$1 [P,L]
# Rewrite index to check for static
RewriteRule ^/$ /index.html [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
# Deflate
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript
# ... text/xml application/xml application/xhtml+xml text/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html