Created
September 1, 2012 14:46
-
-
Save chrisvanpatten/3575736 to your computer and use it in GitHub Desktop.
nginx proxy_pass uploads
This file contains hidden or 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 ~* \.(?:ico|gif|jpe?g|png)$ { | |
| try_files $uri $uri/ @s3; | |
| expires 8h; | |
| add_header Pragma public; | |
| add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
| } | |
| location @s3 { | |
| expires 8h; | |
| add_header Pragma public; | |
| add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
| proxy_cache_methods GET HEAD; | |
| proxy_pass_request_body off; | |
| proxy_set_header Content-Length 0; # prevent big POST-style requests to S3 | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_pass http://your.s3domain.com; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment