ServerName <%= domain %> <%- Array(passenger_server_alii).each do |server_alias| -%> ServerAlias <%= server_alias %> <%- end -%> <%- if passenger_redirect_to_canonical_hostname -%> # Redirect to canonical hostname RewriteEngine On RewriteCond %{HTTP_HOST} !^<%= domain.gsub('.','\.') %> [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/?(.*) http://<%= domain %>/$1 [L,R=301,NE] <%- end -%> DocumentRoot <%= passenger_document_root %> > Allow from all Options -MultiViews CustomLog <%= apache_log_dir %>/<%= application %>-access.log combined ErrorLog <%= apache_log_dir %>/<%= application %>-error.log RackEnv <%= rack_env %> RailsEnv <%= rack_env %> # Enable caching of assets containing a fingerprint # Browsers need never check for newer versions of an # asset because the fingerprint would be different. # Add far-future expiration dates ExpiresActive On ExpiresDefault "access plus 10 years" # Disable ETags Header unset "ETag" # Check for maintenance file and redirect all requests RewriteEngine On RewriteCond %{REQUEST_URI} !\.(css|jpg|png|gif)$ RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /system/maintenance.html [L]