Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to configure Nginx to passing assets from S3.I have the below in the config but when am trying to access frontend, nginx return 404 on static resources. And nginx error log is empty. Can someone please advise what could be wrong with this conf. Thanks.

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;
}
share|improve this question
    
Won't $url_full be just plain woff in this situation? Your first () block? You should probably be using the request URI. –  ceejayoz Apr 11 at 16:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.