Skip to content

Instantly share code, notes, and snippets.

@winmillwill
Created November 5, 2013 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save winmillwill/7320835 to your computer and use it in GitHub Desktop.
Save winmillwill/7320835 to your computer and use it in GitHub Desktop.
Keep your Drupal files in s3
<VirtualHost>
# ...
SSLProxyEngine On
# Since Drupal has infinite terrible file i/o already, doing a stat before proxying and avoiding it doesn't make me feel bad
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/sites/.*/files/(.*)$ https://s3.amazonaws.com/my.sweet.bucket.aws.bucket01/files/$1 [P]
ProxyPassReverse /sites/mysite.dev/files/ https://s3.amazonaws.com/my.sweet.bucket.aws.bucket01/files/
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment