Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using CloudFront as a CDN, and my website as an origin for pulls. Basically, I have pointing over to Cloudfront, and Cloudfront pulls any requests from However, I don't want users to be able to request things like or In fact, I only want to serve up images, JavaScript files, CSS stylesheets, and other static content.

What I've figured out is somewhat of a hack, though it appears to work. I set the Default behavior to point to an Origin called Null. The Null origin points to which doesn't exist, thus any request will just error out. Then, I setup other behaviors for each directory in my website that I want to whitelist. It looks like this:

enter image description here

This appears to work, but is there a better, less hacky solution that I'm missing?

share|improve this question

migrated from Nov 2 '12 at 0:55

This question came from our site for professional and enthusiast programmers.

Yes, a less hacky approach is to just put your static files into an S3 bucket and use the S3 bucket as the origin pull. Leave your webserver out of it altogether.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.