anchor.diff:  <%  if https_sites %>
   <%    https_sites.sort_by { |n,s| s['domain'] }.each do |name, site| %>
   <%      next unless site['redirect'] %>
  +<%      this_domain = site['domain'] || 'test.domain.com' %>
     # <%= name.upcase %> (redirect)
     Service
  -    HeadRequire ".*<%= site['domain'] || 'test.domain.com' %>.*"
  -<%    all_sites.reject { |d| site['domain'] == d }.each do |domain| %>
  -    HeadDeny    ".*<%= domain %>.*"
  +    HeadRequire "Host: <%= this_domain.gsub(/\./, '\.') %>"
  +<%    all_sites.reject { |d| this_domain == d }.each do |domain| %>
  +    HeadDeny    "Host: <%= domain.gsub(/\./, '\.') %>"
   <%    end # all_sites.each %>
       
  -    Redirect "https://<%= site['domain'] || 'test.domain.com' %>"
  +    Redirect "https://<%= this_domain %>"
     End
     
   <%    end # https_sites[:sites].each %>
  
positive.code: <%  if http_sites %>
  <%    http_sites.sort_by { |n,s| s['domain'] }.each do |name, site| %>
  <%      next unless site['redirect'] %>
    # <%= name.upcase %> (redirect)
    Service
      HeadRequire ".*<%= site['domain'] || 'test.domain.com' %>.*"
  <%    all_sites.reject { |d| site['domain'] == d }.each do |domain| %>
      HeadDeny    ".*<%= domain %>.*"
  <%    end # all_sites.each %>
      
      Redirect "http://<%= site['domain'] || 'test.domain.com' %>"
    End
    
  <%    end # http_sites[:sites].each %>
  
negative.code:   Port    80
    xHTTP   1
  <%  http_sites.sort_by { |n,s| s['domain'] }.each do |name, site| %>
  <%    this_domain = site['domain'] || 'test.domain.com' %>
  
    # <%= name.upcase %>
  
    Service
      HeadRequire "Host: <%= this_domain.gsub(/\./, '\.') %>"
  <%    all_sites.reject { |d| this_domain == d }.each do |domain| %>
      HeadDeny    "Host: <%= domain.gsub(/\./, '\.') %>"
  <%    end # all_sites.each %>
  
  <%    1.upto(site['num_ports'] || 5) do |i| %>
  