Skip to content

Instantly share code, notes, and snippets.

@danguita
Last active February 5, 2016 21:23
Show Gist options
  • Save danguita/5077319 to your computer and use it in GitHub Desktop.
Save danguita/5077319 to your computer and use it in GitHub Desktop.
Apache VirtualHost config with Unicorn workers proxy
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName redmine.yourdomain.com
DocumentRoot /home/service/apps/redmine/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>
# Disable log writing for reducing I/O load
ErrorLog /dev/null
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment