Created
November 5, 2010 22:28
-
-
Save huned/664981 to your computer and use it in GitHub Desktop.
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> | |
ServerAdmin [email protected] | |
ServerName example.com | |
ServerAlias www.example.com | |
DocumentRoot "/home/example/apps/example_app/current/public" | |
<Directory "/home/example/apps/example_app/current/public"> | |
Options -Indexes +FollowSymLinks -MultiViews -Includes | |
AllowOverride None | |
Order allow,deny | |
Allow from all | |
</Directory> | |
LogLevel warn | |
ErrorLog /var/log/apache2/example_app.error.log | |
CustomLog /var/log/apache2/example_app.access.log combined | |
RailsEnv staging | |
# Deflate | |
AddOutputFilterByType DEFLATE text/html text/xml text/plain text/css application/x-javascript text/javascript | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip | |
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html | |
# Expires | |
ExpiresActive On | |
<FilesMatch "\.(ico|gif|jpe?g|JPE?G|PNG|png|js|css|flv|swf)$"> | |
ExpiresDefault "access plus 1 month" | |
</FilesMatch> | |
RewriteEngine on | |
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) | |
RewriteRule .* - [F] | |
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f | |
RewriteCond %{REQUEST_URI} !\.(ico|gif|jpe?g|JPE?G|PNG|png|js|css|flv|swf)$ | |
RewriteCond %{SCRIPT_FILENAME} !maintenance.html | |
RewriteRule ^.*$ %{DOCUMENT_ROOT}/system/maintenance.html [L] | |
RewriteCond %{HTTP_HOST} ^example\.com [NC] | |
RewriteRule ^/?(.*)$ http://www.example.com/$1 [R=301,QSA,L] | |
</VirtualHost> | |
<VirtualHost *:443> | |
ServerAdmin [email protected] | |
ServerName example.com | |
ServerAlias www.example.com | |
DocumentRoot "/home/example/apps/example_app/current/public" | |
<Directory "/home/example/apps/example_app/current/public"> | |
Options -Indexes +FollowSymLinks -MultiViews -Includes | |
AllowOverride None | |
Order allow,deny | |
Allow from all | |
</Directory> | |
LogLevel warn | |
ErrorLog /var/log/apache2/example_app.error.log | |
CustomLog /var/log/apache2/example_app.access.log combined | |
RailsEnv staging | |
# Deflate | |
AddOutputFilterByType DEFLATE text/html text/xml text/plain text/css application/x-javascript text/javascript | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip | |
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html | |
# Expires | |
ExpiresActive On | |
<FilesMatch "\.(ico|gif|jpe?g|JPE?G|PNG|png|js|css|flv|swf)$"> | |
ExpiresDefault "access plus 1 month" | |
</FilesMatch> | |
RewriteEngine on | |
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) | |
RewriteRule .* - [F] | |
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f | |
RewriteCond %{REQUEST_URI} !\.(ico|gif|jpe?g|JPE?G|PNG|png|js|css|flv|swf)$ | |
RewriteCond %{SCRIPT_FILENAME} !maintenance.html | |
RewriteRule ^.*$ %{DOCUMENT_ROOT}/system/maintenance.html [L] | |
RewriteCond %{HTTPS_HOST} ^example\.com [NC] | |
RewriteRule ^/?(.*)$ https://www.example.com/$1 [R=301,QSA,L] | |
SSLEngine on | |
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem | |
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment