]> gitweb.fluxo.info Git - puppet-apache.git/commitdiff
Adding support for canonical_exceptions
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 25 May 2012 14:21:26 +0000 (11:21 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 25 May 2012 14:21:26 +0000 (11:21 -0300)
manifests/init.pp
templates/site.erb

index 6b7b382fc37d4775df4e2267d5f58255d2410771..9e9f43fb4a214d474e2ce3868b997f4984b1cf36 100644 (file)
@@ -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",
index 586b158baff309153c01b5bc3a42141bf2795a4a..911d97ada788b47595e74efec22358ee47796c12 100644 (file)
@@ -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]