title: How to make AWS ALB send request origin to lambda
body: <p>For API Gateway + Lambda, the event that is sent to Lambda contains Origin header which can be used to set the &quot;Access-Control-Allow-Origin&quot; header of the response.</p>
  <p>ALB event doesn't seem to contain the <code>Origin</code> header. Is there a way to configure ALB to make it forward a request's <code>Origin</code> header?</p>
  <p>This is an example of an ALB event that arrives at Lambda
  <a href="https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html</a></p>
  <pre><code>{
      &quot;requestContext&quot;: {
          &quot;elb&quot;: {
              &quot;targetGroupArn&quot;: &quot;arn:aws:elasticloadbalancing:us-east-2:123456789012:targetgroup/lambda-279XGJDqGZ5rsrHC2Fjr/49e9d65c45c6791a&quot;
          }
      },
      &quot;httpMethod&quot;: &quot;GET&quot;,
      &quot;path&quot;: &quot;/lambda&quot;,
      &quot;queryStringParameters&quot;: {
          &quot;query&quot;: &quot;1234ABCD&quot;
      },
      &quot;headers&quot;: {
          &quot;accept&quot;: &quot;text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8&quot;,
          &quot;accept-encoding&quot;: &quot;gzip&quot;,
          &quot;accept-language&quot;: &quot;en-US,en;q=0.9&quot;,
          &quot;connection&quot;: &quot;keep-alive&quot;,
          &quot;host&quot;: &quot;lambda-alb-123578498.us-east-2.elb.amazonaws.com&quot;,
          &quot;upgrade-insecure-requests&quot;: &quot;1&quot;,
          &quot;user-agent&quot;: &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36&quot;,
          &quot;x-amzn-trace-id&quot;: &quot;Root=1-5c536348-3d683b8b04734faae651f476&quot;,
          &quot;x-forwarded-for&quot;: &quot;72.12.164.125&quot;,
          &quot;x-forwarded-port&quot;: &quot;80&quot;,
          &quot;x-forwarded-proto&quot;: &quot;http&quot;,
          &quot;x-imforwards&quot;: &quot;20&quot;
      },
      &quot;body&quot;: &quot;&quot;,
      &quot;isBase64Encoded&quot;: false
  }
  </code></pre>