title: Apache ProxyPass not forwarding original http headers to workers
body: <p>I am sending a request to httpd with a setHeader, named.</p>
  
  <p>I see that header if I do not use ModProxy, using getRequestHeader with the header name.</p>
  
  <p>However I need the header information in the ProxyPass workers.</p>
  
  <p>How can I get Apache to forward the headers in ProxyPass.</p>
  
  <p>I have searched for an answer for this for quite a while but I cannot find something that works.</p>
  
  <p>My ProxyPass directive:</p>
  
  <pre><code>&lt;IfModule mod_proxy_fcgi.c&gt;
      #No PATH_INFO with mod_proxy_fcgi unless this is set
      SetEnvIf Request_URI . proxy-fcgi-pathinfo=1
  
      ProxyPass "/gas30/" "fcgi://192.168.1.5:6394/"
      Alias "/gas30" "/opt/fourjs30/gst/gas/bin/fastcgidispatch enablereuse=on"
  
      ProxyPass "/gas31/" "fcgi://192.168.1.5:6395/"
      Alias "/gas31" "/opt/fourjs31/gst/gas/bin/fastcgidispatch enablereuse=on"
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I am using Apache/2.4.6 (CentOS 7)</p>
  
  <p>Thanks in advance</p>
  
  <p>Johan</p>
  
  <p>I use tcpdump to display the header received on Listen port 6380
  Just to make sure it is there.</p>
  
  <p>http_auth: Y2FuY3VuQG1ic2JiYW5rLmNvbScgJzExMTExMTExJyAnJDJhJDEyJDJwMlFOMVNZVURldUlpcWw2R3ZWMk83Mi45QUtXSlROcUlnWDRFQVUvZnJjU01SZnJNQXVL</p>
  
  <p>That is the correct header.</p>
  
  <p>I have tried a lot of things to forward that to port 6395.
  I am totally stuck on that though.
  The last thing I tried was to hard code it under Location.
  But I do not see it in tcpdump</p>
  
  <pre><code>&lt;Location /gas31&gt;
    Header add http_auth "Y2FuY3VuQG1ic2JiYW5rLmNvbScgJzExMTExMTExJyAnJDJhJDEyJDJwMlFOMVNZVURldUlpcWw2R3ZWMk83Mi45QUtXSlROcUlnWDRFQVUvZnJjU01SZnJNQXVL"
    RequestHeader set http_auth "Y2FuY3VuQG1ic2JiYW5rLmNvbScgJzExMTExMTExJyAnJDJhJDEyJDJwMlFOMVNZVURldUlpcWw2R3ZWMk83Mi45QUtXSlROcUlnWDRFQVUvZnJjU01SZnJNQXVL"
    Order Deny,Allow
    Deny from all
    Allow from all
  &lt;/Location&gt;
  </code></pre>
  
  <hr>
  
  <p>I have come to the end of the line with this one, I tried everything and I cannot get the request header to pass through.
  .
  I can either put my header in the JSON messages I send or move to nginx.</p>
  
  <p>Since I have been using httpd for years I will take the first option.</p>
  
  <hr>
  
  <p>I saw this post but I cannot add a comment due to reputation.</p>
  
  <p>Is this relevant ?</p>
  
  <p>If it is where do I put these instructions ?</p>
  
  <hr>
  
  <p>It seems this line preserves the Header for reasons I don't quite understand:</p>
  
  <p>SetEnvIf HTTP_MY_HEADER "(.*)" MY_HEADER=$0
  The reason I don't understand this is that I am setting an Env var here, not a header -- are Env vars automatically turned into headers?</p>
  
  <p>I though I might have to do this also, but was unnecessary:</p>
  
  <p>RequestHeader set HTTP_MY_HEADER "${MY_HEADER}e"
  I suppose this is an answer as "it works", although I would love to know why...</p>