anchor.diff:      rewrite ^(.*) https://$server_name$1 permanent;
     }
   
  -  server { 
  -    listen <%= @ssl_port %>; 
  -    server_name <%= @server_name %>; 
  +  server {
  +    listen <%= @ssl_port %>;
  +    server_name <%= @server_name %>;
       access_log /var/log/chef-server/nginx/access.log opscode;
  -    ssl on; 
  +    ssl on;
       ssl_certificate <%= @ssl_certificate %>;
       ssl_certificate_key <%= @ssl_certificate_key %>;
   
  -    ssl_session_timeout 5m; 
  +    ssl_session_timeout 5m;
   
       ssl_protocols <%= node['chef_server']['nginx']['ssl_protocols'] %>;
  -    ssl_ciphers <%= node['chef_server']['nginx']['ssl_ciphers'] %>; 
  -    ssl_prefer_server_ciphers on; 
  +    ssl_ciphers <%= node['chef_server']['nginx']['ssl_ciphers'] %>;
  +    ssl_prefer_server_ciphers on;
   
       root <%= File.join(@dir, "html") %>;
   
   		client_max_body_size <%= @client_max_body_size %>;
   
  -    proxy_set_header Host $host; 
  -    proxy_set_header X-Real-IP $remote_addr; 
  -    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
  -    proxy_set_header X-Forwarded-Proto https; 
  +    proxy_set_header Host $host;
  +    proxy_set_header X-Real-IP $remote_addr;
  +    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  +    proxy_set_header X-Forwarded-Proto https;
       proxy_pass_request_headers on;
       proxy_connect_timeout   1;
       proxy_send_timeout      300;
  
positive.code: <%-
    def select_upstream(upstream, alternative="chef_server_webui", proto="http") 
  <<-EOS
        set $my_upstream #{upstream};
        if ($http_x_ops_userid = "") {
          set $my_upstream #{alternative};
        }
        proxy_redirect #{proto}://$my_upstream /; 
        proxy_pass #{proto}://$my_upstream; 
  EOS
    end
  -%>
  
negative.code:       proxy_cache_valid 200 302 300m;
        proxy_cache_valid 404 1m;
      }
  
      location / {
      <%= select_upstream("chef_server_api", "chef_server_webui") %>
      }
  