Skip to content

Instantly share code, notes, and snippets.

@simonmorley
Created February 26, 2012 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonmorley/1919382 to your computer and use it in GitHub Desktop.
Save simonmorley/1919382 to your computer and use it in GitHub Desktop.
<VirtualHost *:80>
ServerName xxx
DocumentRoot "/var/www/html/xxx/xxx-staging/public"
CustomLog /var/log/apache2/xxx-staging common
RewriteEngine On
<Proxy balancer://unicornservers>
BalancerMember http://127.0.0.1:5000
</Proxy>
XSendFile On
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>
</VirtualHost>
<VirtualHost *:443>
RewriteEngine On
SSLEngine on
CustomLog /var/log/apache2/xxx-staging common
ServerAdmin webmaster@xxx.com.com
ServerName xxx-staging.xxx.com
SSLCertificateFile /etc/ssl/xxx.crt
SSLCertificateKeyFile /etc/ssl/server.key
SSLCertificateChainFile /etc/ssl/intermediate.pem
# SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
DocumentRoot /var/www/html/xxx/xxx-staging/public
<Proxy balancer://unicornservers>
BalancerMember http://127.0.0.1:5000
</Proxy>
XSendFile On
# 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>
#<LocationMatch "^/assets/.*$">
# Header unset ETag
# FileETag None
# ExpiresActive On
# ExpiresDefault "access plus 1 year"
#</LocationMatch>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment