Skip to content

Instantly share code, notes, and snippets.

@jumping
Last active October 30, 2019 05:10
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 jumping/3c961512edcf87cabc05b7d21af96aae to your computer and use it in GitHub Desktop.
Save jumping/3c961512edcf87cabc05b7d21af96aae to your computer and use it in GitHub Desktop.
nginx proxy request of object on s3
server{
listen 80;
server_name test-mccdn.xxx.com;
location / {
#resolver 8.8.8.8;
#rewrite ^([^.]*[^/])$ $1/ permanent;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Authorization '';
proxy_set_header Host qa-stg-file.s3.cn-northwest-1.amazonaws.com.cn;
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header x-amz-meta-server-side-encryption;
proxy_hide_header x-amz-server-side-encryption;
proxy_hide_header Set-Cookie;
proxy_ignore_headers Set-Cookie;
proxy_intercept_errors on;
add_header Cache-Control max-age=31536000;
proxy_pass http://qa-stg-file.s3.cn-northwest-1.amazonaws.com.cn/;
}
}
server_tokens off;
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment