nginx反向代理到aws S3 ,解决S3返回500、502、503错误

nginx配置如下:

        location ~ .*\.(js|css|woff|woff2|gif|jpg|jpeg|png|bmp|swf|ioc|rar|zip|txt|flv|mid|doc|ppt|pdf|xls|mp3|wma|svg|ico|xml|json|map|xhtml|yaml|cur|eot|ttf|mp4|otf|ogg|webp)$ {
                rewrite ^/(.*) /桶名称/test/static/$1 break;
                error_page 500 502 503 504 400 403 404 = /404.html;
                proxy_http_version     1.1;
                proxy_set_header       Connection "";
                proxy_set_header       Authorization '';
                proxy_set_header       Host s3.us-east-1.amazonaws.com;
                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_h

你可能感兴趣的:(nginx,nginx,aws,运维)