title: Amazon Cloudfront - Pass CDN domain name to origin server
body: <p>I was wondering if Amazon Cloudfront can pass to the origin server the CDN domain name the request is coming from. Let me explain.</p>
  
  <ul>
  <li>I have an external LAMP server, associated to an origin domain (e.g.: origin.mydomain.com)</li>
  <li>I've successfully set up Cloudfront, setting origin.mydomain.com as origin server</li>
  <li>Finally, I pointed 2 different (CDN) domains to Cloudfront (e.g.: www.firstdomain.com and www.seconddomain.com)</li>
  </ul>
  
  <p>Now, all this setup is working perfectly.</p>
  
  <p>But there is 1 information I'm missing: when the origin server (origin.mydomain.com) receives a request, I haven't found a way to know if the request originally comes from www.firstdomain.com or www.seconddomain.com; cloudfront sends to the origin server all information about the request, except the original CDN domain - or if it does, I don't know how/where to get it.</p>
  
  <p>So, resuming, I have this:</p>
  
  <p>DNS domain(s) -> Cloudfront -> Origin domain -> LAMP Server</p>
  
  <p>The question is: how can LAMP get the DNS domain name the request is originally coming from?</p>
  
  <p>Do I miss any cloudfront setting, or there is some trick I can use to get that info ?</p>
  
  <p>Note: I know I can create several properties pointing to the same origin server, but that is not a viable solution for this project.</p>