Created
June 21, 2011 03:34
-
-
Save bunnymatic/1037191 to your computer and use it in GitHub Desktop.
Apache mods to point to a thin server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName sinatra.yourserver.com | |
ServerAlias sinatra.yourserver.com | |
DocumentRoot /home/your_app_user/webapp/current | |
RewriteEngine On | |
<Proxy balancer://thinservers> | |
BalancerMember http://127.0.0.1:5000 | |
BalancerMember http://127.0.0.1:5001 | |
BalancerMember http://127.0.0.1:5002 | |
</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 /usr/local/apache/logs/sinatra_error.log | |
CustomLog /usr/local/apache/logs/sinatra_access.log combined | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment