anchor.diff:  }
   
   {{ range $host, $containers := groupByMulti $ "Env.VHOST" "," }}
  -  upstream {{ $host }} {
  -    {{ range $container := $containers }}
  -      {{ $addrLen := len $container.Addresses }}
  -      {{/* If only 1 port exposed, use that */}}
  -      {{ if eq $addrLen 1 }}
  -        {{ with $address := index $container.Addresses 0 }}
  -           # {{$container.Name}}
  -           server {{ $address.IP }}:{{ $address.Port }};
  +  {{ range $container := $containers }}
  +    {{ if $container.Env.VHOST_PORT }}
  +      {{ range $address := .Addresses }}
  +        {{ if eq $address.Port $container.Env.VHOST_PORT }}
  +          upstream {{ $host }} {
  +             # {{$container.Name}}
  +             server {{ $address.IP }}:{{ $address.Port }};
  +          }
           {{ end }}
  -      {{/* If more than one port exposed, use the one matching VHOST_PORT env var */}}
  -      {{ else if $container.Env.VHOST_PORT }}
  -        {{ range $address := .Addresses }}
  -           {{ if eq $address.Port $container.Env.VHOST_PORT }}
  -           # {{$container.Name}}
  -           server {{ $address.IP }}:{{ $address.Port }};
  -           {{ end }}
  -        {{ end }}
  -      {{/* Else default to standard web port 80 */}}
  -      {{ else }}
  -        {{ range $address := $container.Addresses }}
  -          {{ if eq $address.Port "80" }}
  -          # {{$container.Name}}
  -          server {{ $address.IP }}:{{ $address.Port }};
  -          {{ end }}
  +      {{ end }}
  +    {{ else }}
  +      {{ range $address := $container.Addresses }}
  +        {{ if eq $address.Port "80" }}
  +          upstream {{ $host }} {
  +             # {{$container.Name}}
  +             server {{ $address.IP }}:{{ $address.Port }};
  +          }
           {{ end }}
         {{ end }}
       {{ end }}
  -  }
   
  -  upstream {{ $host }}_ssl {
  -    {{ range $container := $containers }}
  -      {{ $addrLen := len $container.Addresses }}
  -      {{/* If only 1 port exposed, use that */}}
  -      {{ if eq $addrLen 1 }}
  -        {{ with $address := index $container.Addresses 0 }}
  -           # {{$container.Name}}
  -           server {{ $address.IP }}:{{ $address.Port }};
  -        {{ end }}
  -      {{/* If more than one port exposed, use the one matching VHOST_PORT_SSL env var */}}
  -      {{ else if $container.Env.VHOST_PORT_SSL }}
  -        {{ range $address := .Addresses }}
  -           {{ if eq $address.Port $container.Env.VHOST_PORT_SSL }}
  -           # {{$container.Name}}
  -           server {{ $address.IP }}:{{ $address.Port }};
  -           {{ end }}
  -        {{ end }}
  -      {{/* Else default to standard web port 443 */}}
  -      {{ else }}
  -        {{ range $address := $container.Addresses }}
  -          {{ if eq $address.Port "443" }}
  -          # {{$container.Name}}
  -          server {{ $address.IP }}:{{ $address.Port }};
  -          {{ end }}
  +    {{ if $container.Env.VHOST_PORT_SSL }}
  +      {{ range $address := .Addresses }}
  +         {{ if eq $address.Port $container.Env.VHOST_PORT_SSL }}
  +          upstream {{ $host }}_ssl {
  +             # {{$container.Name}}
  +             server {{ $address.IP }}:{{ $address.Port }};
  +          }
  +         {{ end }}
  +      {{ end }}
  +    {{ else }}
  +      {{ range $address := $container.Addresses }}
  +        {{ if eq $address.Port "443" }}
  +          upstream {{ $host }}_ssl {
  +             # {{$container.Name}}
  +             server {{ $address.IP }}:{{ $address.Port }};
  +          }
           {{ end }}
         {{ end }}
       {{ end }}
  -  }
  +  {{ end }}
   
     server {
       listen 80;
  
positive.code: 
  gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  
  # HTTP 1.1 support
  proxy_http_version 1.1;
  proxy_buffering off;
  
  
negative.code: map $http_x_forwarded_proto $proxy_x_forwarded_proto {
    default $http_x_forwarded_proto;
  
    '' $scheme;
  }
  
  map $http_upgrade $proxy_connection {
    default upgrade;
  
  