I am focusing on just a little webapp (all client-side) I wish to host it on Amazon . com S3. I have found several guides about this and also have handled to produce myself a bucket (with similar title as my domain), place it like a website and upload some content.
Where I am battling, and where all of the documentation begins to obtain a little vague, is how you can correctly configure my DNS.
My registrar (123-reg) could suggest was web sending which provides me mydomain.com.s3.amazonaws.com
What must i configure, and where (ie. 123-reg / Amazon . com) can one obtain a clean URL?
To host your S3 website using bucket explorer tool.
Refer : Host Static Website
Seems like you have done the majority of the work already. For clearness I'll review individuals steps again simply to make certain you are setup correctly:
Create an s3 bucket making use of your domain title because the bucket title (your bucket title ought to be www.example.com if you would like your website to become example.com or www.example.com)
Upload your articles towards the s3 bucket. Select a consistent reputation for your site index files (index.html usually). You may also upload a custom page for 404 Not Found errors. Refer to this as 404.html. Give Read permissions to each file inside your website to ensure that the general public can observe it. Don't give any other permissions towards the bucket, only the files within.
Configure your bucket like a website. Using the AWS console ( https://console.aws.amazon.com/s3/ ) you are able to choose your bucket, click qualities, then choose the "Website" tab. Click enabled and hang your index document to "index.html" as well as your error document to "404.html".
Take some the "Endpoint" URL within the website configuration tab. This is when your site lives. You are able to open the hyperlink inside a new window and you ought to call at your website just like it'll look. Click around and make certain everything works not surprisingly.
You Have To make use of the endpoint address in most steps below. The standard www.example.com.s3.amazonaws.com will not work - you should utilize the regional version (http://www.example.com.s3-website-us-east-1.amazonaws.com/)
Now, we are able to setup the DNS to provide you with a clean, custom URL.
First, we'll map www.example.com for your site.
Making use of your DNS provider's tools, (123-reg inside your situation) you have to produce a CNAME record to map www.example.com to www.example.com.s3-website-us-east-1.amazonaws.com
The CNAME may be the only factor you'll need should you simply want www.example.com. Many people likewise want "example.com" to operate therefore we need another step.
example.com is frequently known to like a naked domain or even the apex record from the domain. The reson it is a problem is it can not be a CNAME. CNAMEs only focus on subdomains like "www." This causes it to be harder to suggest at s3.
The typical approach is by using something to instantly redirect any request likely to example.com to suggest to www.example.com. This can then get your CNAME record plus you site is going to be offered from s3.
The automated redirect isn't feasible with common DNS so make use of another service. Some DNS companies offer this particular service together with their DNS (godaddy does, amazon . com route53 doesn't. Unsure about 123-reg)
In case your DNS provider does not get it done, you will find a couple of free websites. One which I have used is http://wwwizer.com/naked-domain-redirect - it does not require any registration or payment.
To make use of this kind of service, you have to produce a DNS "A" record for the naked domain. For that wwwizer.com service, you should create a b record to suggest example.com to 126.96.36.199. That's all!
So, with this particular setup, if your user types example.com to their browser, the next happens:
- DNS query: example.com -> 188.8.131.52 (wwwizer.com's service)
- HTTP request to 184.108.40.206 for instance.com
- 220.127.116.11 redirects example.com -> www.example.com
- DNS query: www.example.com -> CNAME to www.example.com.s3-website-us-east-1.amazonaws.com
- DNS query: www.example.com.s3-website-us-east-1.amazonaws.com -> indicates Amazon . com S3
- HTTP request www.example.com has become offered by Amazon . com S3