anchor.diff:  
     location @app {
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  +    proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header Host $http_host;
  +    proxy_redirect off;
  +
  +    if ($ssl_protocol != "") {
  +      proxy_set_header HTTPS "on";
  +    }
   
       proxy_pass http://<%= app %>;
     }
  
positive.code:   <% if force_ssl %>
    if ($ssl_protocol = "") {
       rewrite ^   https://$server_name$request_uri? permanent;
    }    
    <% end %>
    
    <% end %>
  
negative.code:   listen 80;
    server_name <%= additional_domains %> <%= app %>.<%= base_domain %>;
  
  
    <% if use_ssl %>
    listen 443 ssl;
  