我正在尝试将Nginx配置为从S3传递资产。我在配置中有以下内容但是当我尝试访问前端时,nginx在静态资源上返回404。并且nginx错误日志为空。有人可以告诉这个conf可能有什么问题。感谢。
location ~* \.(ttf|woff|svg|ico|css|js|png|jpeg|html|json)($|\?) {
set $s3_bucket 'bucketname.s3.amazonaws.com';
set $url_full '$1';
proxy_http_version 1.1;
proxy_set_header Host $s3_bucket;
proxy_set_header Authorization '';
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header Set-Cookie;
proxy_ignore_headers "Set-Cookie";
proxy_buffering off;
proxy_intercept_errors on;
resolver 8.8.4.4 8.8.8.8 valid=300s;
resolver_timeout 10s;
proxy_pass https://$s3_bucket/$url_full;
}