Serve up s3 file with nginx

Solution 1:

Why bring nginx into the mix? Just serve the file up to the user's browser directly out of S3.

To do this, ensure that the ACL on your S3 bucket allows read access from anonymous users. The URLs to your files there are as follows:

https://s3.amazonaws.com/<bucket_name>/<file_name>

You can also create a CNAME record to serve S3 files from your own domain. Keep in mind that the bucket name has to be identical to the domain you'll be using (i.e. static.example.com) - see S3 documentation for more info on that.