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 currently have a production web site which hosts a large volume 50GB+ of images on s3. For my staging environment at first I was cloning the production bucket into a staging bucket but this has become too large to maintain.

The changes that occur on staging must continue to be isolated to the staging environment and not touch production.

What are the best options for redirecting missing staging assets to production? I have seen this article which is an example:

This is rails + unicorn + nginx + S3.

share|improve this question
Can you be more specific about 'changes that occur in staging must be isolated'? Do you have a specific location {} block for your assets? – polynomial Sep 15 '11 at 5:05
paperclip is used. each environment has its own options. – pablo Sep 15 '11 at 16:25

I guess you worry about the if directive. If so, you can use try_files instead, something like this:

    location ~* \.(jpe?g|gif|png)$ {
        try_files $uri @missing;
    location @missing {
        rewrite ^/(.*)$1 permanent;
share|improve this answer
While try_files is a good option it doesn't really solve my issues. With this setup how can I see changes I made to staging as the assets aren't local, they are on a staging bucket? – pablo Sep 15 '11 at 16:24

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.