<VirtualHost *:80>

  ServerAdmin admin@yourdomain.com
  ServerName yourdomain.com
  ServerAlias www.yourdomain.com

  DocumentRoot /path/to/deploy_to/current/public

  RewriteEngine On

  <Proxy balancer://unicornservers>
    BalancerMember http://127.0.0.1:5000
  </Proxy>

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

  ProxyPass / balancer://unicornservers/
  ProxyPassReverse / balancer://unicornservers/
  ProxyPreserveHost on

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  ErrorLog ${APACHE_LOG_DIR}/yourdomain.error.log
  CustomLog ${APACHE_LOG_DIR}/yourdomain.access.log combined

</VirtualHost>
