summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-05-25 11:21:26 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-05-25 11:21:26 -0300
commitb9aa3c0d2d3cc594f57a6a02828f11c650657b3a (patch)
treef297c7d91ce6ef541bced85d580fefe3dbe85d1e
parent497082ae8f6811ba98a92a16e26073d8f13557f5 (diff)
downloadpuppet-apache-b9aa3c0d2d3cc594f57a6a02828f11c650657b3a.tar.gz
puppet-apache-b9aa3c0d2d3cc594f57a6a02828f11c650657b3a.tar.bz2
Adding support for canonical_exceptions
-rw-r--r--manifests/init.pp2
-rw-r--r--templates/site.erb3
2 files changed, 4 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 6b7b382..9e9f43f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -191,7 +191,7 @@ class apache {
$comment = '', $sshkey = absent,
$groups = '', $shell = '/bin/false', $manage_user = true,
$ssl = false, $listen = '*', $https_redirect = false,
- $canonical = false) {
+ $canonical = false, $canonical_exceptions = '') {
$vhost = $filename ? {
'' => "$title",
diff --git a/templates/site.erb b/templates/site.erb
index 586b158..911d97a 100644
--- a/templates/site.erb
+++ b/templates/site.erb
@@ -26,6 +26,9 @@
</IfModule>
<% end %>
<% if canonical != false %>
+ <%- for canonical_exception in canonical_exceptions -%>
+ RewriteCond %{HTTP_HOST} !=<%= canonical_exception %> [NC]
+ <%- end -%>
RewriteCond %{HTTP_HOST} !=<%= canonical %> [NC]
RewriteCond %{HTTP_HOST} !=""
RewriteRule ^/(.*) <%= protocol %>://<%= canonical %>/$1 [L,R=301]