title: nginx $scheme variable behind load balancer
body: <p>Is it possible to force nginx <em>$scheme</em> value to "https" if nxinx is running behind load balancer?</p>
  
  <p>In my scenario Load balancer takes care of https communication with client and forwards requests to nginx as raw http. I know I can do something like this to detect https</p>
  
  <pre><code>set $my_scheme "http";
  if ($http_x_forwarded_proto = "https") {
      set $my_scheme "https";
  }  
  </code></pre>
  
  <p>but I'm just curious if there is something like <code>real_ip_header</code> function for IPs.</p>
  
  <p>Are there also some headers I need to update when detecting https manualy?</p>