Created
February 16, 2011 12:37
-
-
Save zefer/829301 to your computer and use it in GitHub Desktop.
Simple nginx config to allow CORS (cross-site) uploads to Amazon S3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location / { | |
if ($request_method = 'OPTIONS') { | |
more_set_headers 'Access-Control-Allow-Origin: *'; | |
more_set_headers 'Access-Control-Allow-Methods: POST, OPTIONS'; | |
more_set_headers 'Access-Control-Max-Age: 1728000'; | |
more_set_headers 'Content-Type: text/plain; charset=UTF-8'; | |
return 200; | |
} | |
if ($request_method = 'POST') { | |
more_set_headers 'Access-Control-Allow-Origin: *'; | |
proxy_pass http://your-s3-bucket; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment