Skip to content

Instantly share code, notes, and snippets.

@heldopslippers
Created September 11, 2010 15:41
Show Gist options
  • Save heldopslippers/575280 to your computer and use it in GitHub Desktop.
Save heldopslippers/575280 to your computer and use it in GitHub Desktop.
#NameVirtualHost *:80
# no www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1$1 [R=301,L]
<VirtualHost *:80>
ServerName webCMS
ServerAlias webCMS
DocumentRoot /mnt/apps/webCMS/current/public
RewriteEngine On
<Proxy balancer://thinservers>
BalancerMember http://127.0.0.1:50000
BalancerMember http://127.0.0.1:50001
BalancerMember http://127.0.0.1:50002
</Proxy>
# Redirect all non-static requests to thin
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L]
ProxyPass / balancer://thinservers/
ProxyPassReverse / balancer://thinservers/
ProxyPreserveHost on
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
# Custom log file locations
ErrorLog /mnt/apps/webCMS/shared/log/error.log
CustomLog /mnt/apps/webCMS/shared/log/access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment