Audrey M. Roy

Art, design, Python, JavaScript, and general silliness 
« Back to blog

Serving static websites with Amazon S3+CloudFront, GoDaddy, Nginx, and a VPS

S3 is good for serving static files in situations where you may need
to deal with unexpected spikes in traffic. You can use any S3
uploader such as S3Fox or S3 Organizer to create a bucket for your
files and then upload them. This requires no programming.

With a couple more clicks, you can turn an S3 bucket into a CloudFront
bucket. Then, the bucket can be used as a simple content delivery
network. I pointed http://cdn.fuzzyrainbow.com to my CloudFront
bucket by editing my GoDaddy control panel cname settings for
fuzzyrainbow.com.

You'd be able to use the S3/CloudFront bucket as-is as a static web
server if it weren't for Amazon's inability to serve default index
pages. I fiddled with S3, CloudFront, and GoDaddy for a bit, but I
couldn't get http://www.fuzzyrainbow.com to automatically serve
index.html.

My quick solution to this was to install Nginx on my VPS to serve the
default index page and the .js files. I put those files into a
directory on my VPS and edited my nginx.conf to serve those files.
The images and stylesheets linked from index.html are retrieved from
http://cdn.fuzzyrainbow.com, my fancy little CDN.

I've put up the files for http://www.fuzzyrainbow.com here:
http://github.com/audrey/fuzzyrainbowcom

Posted by Audrey M Roy 

Comments (2)

Nov 03, 2011
mikespringer said...
I was complaining to my girlfriend about time zones to Buy Viagra and I got a little passionate about the subject, which she found amusing. So, instead of realizing that this was a total nerd-rage moment, I decided to take it to the next level and make a website to share my righteous fury with the world (as I am wont to do.) I had an Amazon AWS account, had heard about Amazon’s S3 / Cloudfront CNAME support and decided to give that a try instead of fiddling with nginx configs on one of my other servers. Long story short: an nginx config would have been a lot easier.
Mar 21, 2012
web hosting said...
I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!hosting india

Leave a comment...