Skip to content

Commit

Permalink
Added: Example AWS + Varnish + Apache + Static Cache + ModRewrite Vir…
Browse files Browse the repository at this point in the history
…tual Host configuration
  • Loading branch information
brookinsconsulting committed Jan 6, 2017
1 parent a4d4216 commit 59d3c36
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions config/etc/apache2/sites-available/ezecosystem.include
@@ -0,0 +1 @@
<VirtualHost :8090> DocumentRoot /srv/www/ezecosystem/ezpublish_legacy CustomLog /var/log/apache2/ezecosystem_access.log forwarded ErrorLog /var/log/apache2/ezecosystem_error.log ServerName www.ezecosystem.org ServerAlias admin.ezecosystem.org ezecosystem.org dev.ezecosystem.org ezecosystem.ccplatform.net ezecosystem.health.ccplatform.net ezecosystem.flux.ccplatform.net ServerAlias ezecosystem.org *.ezecosystem.com *.ezecosystem.org ezecosystem.com ServerAlias ezpublishlegacy.com *.ezpublishlegacy.com ServerAdmin root@thinkcreative.com Include /etc/apache2/common/filesmatch.conf php_value max_execution_time 200 php_value upload_max_filesize 150M php_value post_max_size 150M php_value memory_limit 512M RewriteEngine On RewriteCond %{HTTP_HOST} ^www.(.*)?$ RewriteRule ^(.*)$ http://%1$1 [L,R=301] RewriteCond %{HTTP_HOST} ezecosystem.com RewriteRule ^(.*)$ http://ezecosystem.org$1 [L,R=301] # Static cache in eZ Publish # Redirect home page requests to static default siteaccess cache # Only cache specific hostname request RewriteCond %{HTTP_HOST} ^(ezecosystem.org)$ # No cache for http posts RewriteCond %{REQUEST_METHOD} !^POST$ # Do not cache vhost admin RewriteCond %{HTTP_HOST} !^admin.*$ # Non caching vhost for passing the static cache RewriteCond %{HTTP_HOST} !^nocache.*$ # Do not cache server based request RewriteCond %{HTTP_USER_AGENT} !^eZ\ Publish\ static\ cache\ generator$ # Redirect home page requests to static default siteaccess cache RewriteCond %{QUERY_STRING} ^$ RewriteCond %{DOCUMENT_ROOT}/var/ezwebin_site/static/ezecosystem.org/index\.html -f RewriteRule ^/?$ %{DOCUMENT_ROOT}/var/ezwebin_site/static/ezecosystem.org/index\.html [L] # Only cache specific hostname request RewriteCond %{HTTP_HOST} ^(ezecosystem.org)$ # No cache for http posts RewriteCond %{REQUEST_METHOD} !^POST$ # Do not cache vhost admin RewriteCond %{HTTP_HOST} !^admin.*$ # Non caching vhost for passing the static cache RewriteCond %{HTTP_HOST} !^nocache.*$ # Do not cache server based request RewriteCond %{HTTP_USER_AGENT} !^eZ\ Publish\ static\ cache\ generator$ # Does the index.html exist in the static cache? RewriteCond %{DOCUMENT_ROOT}/var/ezwebin_site/static/ezecosystem.org$1/index.html -f # Rewrite to the static cache RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/var/ezwebin_site/static/ezecosystem.org$1/index.html [L] # Allow all robots to index site RewriteRule ^/sitemap\.xml - [L] # Only give good robots access to main site and not other vhost aliases RewriteCond %{HTTP_HOST} ^ezecosytem.org$ RewriteRule ^/robots\.txt - [L] RewriteCond %{HTTP_HOST} ccplatform.net|ssd.thinkcreativeinternal.net|admin|nocache|cache RewriteRule ^/robots\.txt %{DOCUMENT_ROOT}/extension/ezecosystem/design/eze/root/robots_disallow.txt [L] # Google webmaster auth rule RewriteRule ^/google2bddfd3442a88779\.html - [L] # Platform for Privacy Preferences Project ( P3P ) related files # for Internet Explorer # More info here : http://en.wikipedia.org/wiki/P3p RewriteRule ^/w3c/p3p\.xml - [L] RewriteRule (.*)?/$ $1 RewriteRule . - [E=eze_static_matches:/ezwebin_site/static/ezecosystem.ccplatform.net] RewriteCond %{HTTP_HOST} !admin RewriteCond %{THE_REQUEST} !site_admin RewriteCond %{HTTP_COOKIE} !is_logged_in [NC] RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{QUERY_STRING} ^$ RewriteCond %{DOCUMENT_ROOT}/var%{ENV:eze_static_matches}/index.html -f RewriteRule ^/?$ %{DOCUMENT_ROOT}/var%{ENV:eze_static_matches}/index.html [L] RewriteCond %{HTTP_HOST} !admin RewriteCond %{THE_REQUEST} !site_admin RewriteCond %{HTTP_COOKIE} !is_logged_in [NC] RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{QUERY_STRING} ^$ RewriteCond %{REQUEST_URI} !^/Area-Events/Events-Calendar RewriteCond %{REQUEST_URI} !^/Things-To-Do/Ski-Snowboard RewriteCond %{REQUEST_URI} !^/Things-To-Do/Winter-Adventures/Downhill-Skiing-Snowboarding RewriteCond %{REQUEST_URI} !^/users RewriteCond %{REQUEST_URI} !^/mobile RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}/var%{ENV:eze_static_matches}/%{REQUEST_URI}/index.html -f RewriteRule /(.*)? %{DOCUMENT_ROOT}/var%{ENV:eze_static_matches}/$1/index.html [L] Include /etc/apache2/common/rewrite.conf</VirtualHost>
Expand Down

0 comments on commit 59d3c36

Please sign in to comment.