anchor.diff:  
     RewriteEngine On
     RewriteCond %{HTTP_HOST} !^(<%= @servername %>(:<%= _port %>)?)?$ [NC]
  -  RewriteRule ^(.*) <%= _scheme %>://<%= @servername %>:<%= _port %>$1 [R=301,L]
  +  RewriteRule ^(.*) <%= @ssl ? "https" : "http" %>://<%= @servername %>:<%= _port %>$1 [R=301,L]
     <%- end -%>
   
     <%- if @ssl -%>
  
positive.code:   <%- if @pun_uri && @nginx_uri -%>
    # Reverse proxy traffic to backend PUNs through Unix domain sockets:
    #
    #     <%= _scheme %>://<%= _host %>:<%= _port %><%= @pun_uri %>/dev/app/simulations/1
    #     #=> unix:/path/to/socket|http://localhost<%= @pun_uri %>/dev/app/simulations/1
    #
    SetEnv OOD_PUN_URI "<%= @pun_uri %>"
  
negative.code: <% end -%>
  
  <%# Set default URI values used for redirecting -%>
  <% _host   = @servername || "%{SERVER_NAME}"    -%>
  <% _port   = @port || (@ssl ? "443" : "80")     -%>
  
  <% if @ssl -%>
  # Redirect all http traffic to the https Open OnDemand portal URI
  #     http://*:<%= _port %>
  #     #=> <%= @ssl ? "https" : "http" %>://<%= _host %>:<%= _port %>
  #
  <VirtualHost *:80>
    RewriteEngine On
    RewriteRule ^(.*) <%= @ssl ? "https" : "http" %>://<%= _host %>:<%= _port %>$1 [R=301,L]
  </VirtualHost>
  <% end -%>
  
  