My videos are in a S3 bucket and WordPress site is on Lightsail.
I have set up a cloudfront distribution so that the videos are served from cloudfront CDN instead of pulling from S3. The S3 bucket is public along with all the videos files in it.
The problem is that the cloudfront URL returns an error - NoSuchKeyThe specified key does not exist.
Anyone know how I can fix this?
thank you
Related
I have a node.js app that I need to host on namecheap, It also involves file handling. does name cheap provides any thing like s3 bucket where I can store files or do I have to use s3?
If I use s3 and host my app on namecheap, won't it be bad implementation because files are on a separate server than the app and cause longer loading time?
I'm using Amazon S3 to serve my static and media files to my django website. Do I need to Allow Public access in my Amazon S3 bucket or is there any secure way to do this
I want a static/html Website to be hosted on Google Bucket. Let's say example.com to be hosted on Google Cloud Storage Bucket.
But then Google is asking me to verify domain ownership by UPLOADING A FILE onto the site?
But as I mentioned, I want to host the website inside the Google Bucket. Then how do I upload the file without having the Bucket first? This is becoming a chicken and egg problem to me.
Someone help me with this step, please.
Google support several methods to validate domain control.
Since you do not have a website setup yet, chose the Domain name provider method. Using this method you create a special DNS TXT record in your DNS server. Google reads this DNS TXT record which verifies that you have control of the domain name.
Google Verification Methods
Im facing some problems with AWS S3, i figured out that if i set some RoutingRules, it will only works at <bucket_name>.s3-website-us-east-1.amazonaws.com endpoint but this endpoint don't have SSL, is there another endpoint that has SSL s3.amazonaws.com/<bucket_name> but these RoutingRules doesn't work there.
Is there a way to make RoutingRules works at s3.amazonaws.com/<bucket_name> endpoint? or SSL works at <bucket_name>.s3-website-us-east-1.amazonaws.com?
I hear something about cloudfront but idk much about.
<bucket_name>.s3-website-us-east-1.amazonaws.com is a website endpoint, whereas the other one is a REST API endpoint. You can see the difference here.
You can see the example walkthroughs how to setup a static website on S3 and add CloudFront (where you can add SSL/TLS).
For your use case, as you have already identified you can use AWS CloudFront. It mainly provides two functions,
Acts as a CDN caching the static content based on your configuration.
Acts as a proxy where you can connect S3 buckets or other endpoints to CloudFront with routing rules where your DNS points to CloudFront.
In addition you can associate AWS Certificate Manager issued free SSL certificates with CloudFront.
Configuring CloudFront to S3 is straightforward. Check the AWS Getting Started Guide for more details.
I was wondering if Amazon Cloudfront can pass to the origin server the CDN domain name the request is coming from. Let me explain.
I have an external LAMP server, associated to an origin domain (e.g., origin.mydomain.com)
I've successfully set up Cloudfront, setting origin.mydomain.com as origin server
Finally, I pointed 2 different (CDN) domains to Cloudfront (e.g., www.firstdomain.com and www.seconddomain.com)
Now, all this setup is working perfectly.
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.
So, resuming, I have this:
DNS domain(s) -> Cloudfront -> Origin domain -> LAMP Server
The question is: How can LAMP get the DNS domain name the request is originally coming from?
Do I miss any cloudfront setting, or there is some trick I can use to get that info?
Note: I know I can create several properties pointing to the same origin server, but that is not a viable solution for this project.
You'll have to use the logging in Cloudfront, because the only time that Cloudfront actually makes requests to your server is when they do not have a cached version of that particular file.
To turn on logging you need to log into the AWS Console and choose Edit in the Distribution Details for the distribution you want to enable access logs to be delivered. Then you set the target bucket and prefix for AWS to deliver log files to. The logging target should be another S3 bucket than the origin. Otherwise your report will include requests for log files delivered by Amazon and download requests for log files.
When you configure logging it will save logs in the bucket you specified in this format: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html#LogFileFormat