Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>Update</h2> <p>Avinash Bijja correctly <a href="https://stackoverflow.com/a/13751637/45773">pointed out</a> (+1) that the HTTP <a href="http://en.wikipedia.org/wiki/User_agent" rel="nofollow noreferrer">User-agent</a> header <em>would be 'Amazon CloudFront'</em> for requests coming from Amazon CloudFront servers. Unfortunately this doesn't seem to be explicitly documented indeed, but is implicitly acknowledged by various posts in the respective forum, see e.g. the AWS Team response to <a href="https://forums.aws.amazon.com/thread.jspa?messageID=420294#420294" rel="nofollow noreferrer">User Agent String - does CF overwrite the user agent string?</a>:</p> <blockquote> <p>You are correct. The User-Agent field is always populated as "Amazon CloudFront".</p> </blockquote> <p><strike>However, it turns out this is not currently entirely reliable, insofar <a href="https://forums.aws.amazon.com/message.jspa?messageID=370577#370577" rel="nofollow noreferrer">CloudFront sends an empty User-Agent to the origin</a> if one is missing in the originating client request already:</p> <blockquote> <p>I can confirm that CloudFront is not sending a User-Agent to the origin when the original client does not send a User-Agent. We have enhancements &amp; fixes to User-Agent handling on our backlog, but no release dates at this time. I've sent you a PM with further details.</p> </blockquote> <p>These enhancements &amp; fixes are apparently not rolled out still as of February 07 2013 at least. </strike></p> <p>These enhancements &amp; fixes <a href="https://forums.aws.amazon.com/message.jspa?messageID=370577#475819" rel="nofollow noreferrer">have been rolled out as of August 05 2013</a> (thanks <a href="https://stackoverflow.com/questions/13524973/is-there-any-way-to-identify-requests-coming-to-custom-origin-server-from-cloudf/13550795?noredirect=1#comment27667418_13550795">webbiedave</a> for the update!).</p> <hr> <h2>Initial Answer</h2> <blockquote> <p>Does CloudFront add any custom headers to requests sent to origin server?</p> </blockquote> <p>One would think so indeed, but at least they don't appear to be documented where I would have expected it, namely in <a href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html#RequestBehaviorCustomOrigin" rel="nofollow noreferrer">How CloudFront Processes and Forwards Requests to Your Custom Origin Server</a>. Given you are in control of the origin server, you might just check its HTTP access logs though?</p> <blockquote> <p>Or is there any other reliable way to determine that requests is coming from CloudFront?</p> </blockquote> <p>You'll need to judge the reliability yourself, but <em>The IP address that CloudFront forwards to the origin server is the IP addresses of a CloudFront server, not the IP address of the end user's computer.</em> - consequently you could restrict access to the published <a href="https://forums.aws.amazon.com/ann.jspa?annID=910" rel="nofollow noreferrer">Amazon CloudFront Public IP Ranges</a>; however, be aware of the respective disclaimer:</p> <blockquote> <p>The CloudFront IP addresses change frequently and we cannot guarantee advance notice of changes. On a best-effort basis, we will provide the list of current addresses. <strong>Customers should not use these addresses for mission critical applications</strong> and must never hard code them in DNS names. <em>[emphasis mine]</em></p> </blockquote> <p>Consequently you'll need to monitor this forum/post to take notice of respective changes as early as possible (if this constraint is acceptable for your use case in the first place of course).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload