anchor.diff:      proxy_connect_timeout   300;
       proxy_redirect          off;
   
  -    proxy_set_header   X-Forwarded-Proto $scheme;
  -    proxy_set_header   Host              $http_host;
  -    proxy_set_header   X-Real-IP         $remote_addr;
  -    proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
  -    proxy_set_header   X-Frame-Options   SAMEORIGIN;
  +    proxy_set_header    Host                $http_host;
  +    proxy_set_header    X-Real-IP           $remote_addr;
  +    <% if @https %>
  +    proxy_set_header    X-Forwarded-Ssl     on;
  +    <% end %>
  +    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
  +    proxy_set_header    X-Forwarded-Proto   $scheme;
  +    proxy_set_header    X-Frame-Options     SAMEORIGIN;
   
  -    <% if @https %>
  -    proxy_set_header   X-Forwarded-Ssl     on;
  -    <% end %>
       proxy_pass http://gitlab;
     }
   
  
positive.code: ###################################
  ##         configuration         ##
  ###################################
  ##
  
  upstream gitlab {
    server unix:<%= @socket %>;
  }
  
  <% if @https && @redirect_http_to_https %>
  server {
  <% @listen_addresses.each do |listen_address| %>
    listen <%= listen_address %>:<%= @redirect_http_to_https_port %>;
  <% end %>
    server_name <%= @fqdn %>;
    server_tokens off;
    return 301 https://<%= @fqdn %>:<%= @port %>$request_uri;
    access_log  <%= @log_directory %>/gitlab_access.log;
    error_log   <%= @log_directory %>/gitlab_error.log;
  
negative.code: # and run `sudo gitlab-ctl reconfigure`.
  
  ## GitLab
  ## Contributors: randx, yin8086, sashkab, orkoden, axilleas, bbodenmiller
  ##
  ## Modified from https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab-ssl & https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab
  ##
  ## Lines starting with two hashes (##) are comments with information.
  ## Lines starting with one hash (#) are configuration parameters that can be uncommented.
  