Created
May 5, 2015 02:14
-
-
Save tzangms/621f0ce572141b8b652e to your computer and use it in GitHub Desktop.
Nginx to S3 Reverse proxy config
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 ~ ^/(.*)$ { | |
resolver 8.8.8.8 valid=300s; | |
resolver_timeout 10s; | |
set $s3_bucket '<bucket-name>.com.s3.amazonaws.com'; | |
set $url_full '$1'; | |
proxy_pass http://$s3_bucket/$url_full; | |
proxy_buffering off; | |
proxy_set_header Host $s3_bucket; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
add_header X-Cache-Status $upstream_cache_status; | |
proxy_hide_header x-amz-id-2; | |
proxy_hide_header x-amz-request-id; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment