Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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: http://containerdiv.wordpress.com/2009/05/01/safely-using-production-assets-in-staging/

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. github.com/thoughtbot/paperclip. each environment has its own options. –  pablo Sep 15 '11 at 16:25
add comment

1 Answer

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 ^/(.*) http://production.yoursite.com/$1 permanent;
        break;
    }
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
add comment

Your Answer

 
discard

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.